I already search by this topic in the forum searh engine , and i have found a lot of issues related with this topic but none of these have clarified me.
I read that when you create a Date object like this away Date d = new Date(); , that will contain the date in UTC(number of miliseconds since 01/01/1970), but when i simple
do System.out.println(d) this will print the date in my local machine timezone.
How can I have a Date object with the UTC time ?
Use SimpleDateFormat to format the date string output. If you read the API docs for Date and it's toString method (which is what at work there) it clearly states that the date will presented in the machines local timezone, but the actual date object is still a UTC Date Time representation, you are simply seeing the String representation of that time in your timezone when you use toString().