android - A question of time.. and how to manipulate it in java -


I have a question about working with Java over time, and more specifically in Android.

I am developing a device to see if updates are made with a remote server today or not.

So my code is as follows:

    calendar now = calendar.jistence (); Long millisecond = now. Get Timinimis (); Long_monit = millisecond% (86400000); Long checkpoint = (millisecond - from_midrite);  

However, when I change the date using the checkpoint variable:

  SimpleDateFormat formatter = New SimpleDateFormat ("dd / MM / yyyy hh: Mm: ss "); Last_logged_text = formatter.format;  

I get a one-time representation for 1 a.m. this morning.

I know that this is something with the daylight saving time, but I am sure how it works around it.

Any help has been greatly appreciated.

thanks

The reason for the era and now Different timezone is, effectively, thanks to DST, as you say.

There is a better way to do whatever you want, now 'stop' time, leaving midnight last night.

  Calendar Midnight = Calendar.Ast Instance (); Midnight .set (calendar. HOUR_OF_DAY, 0); Midnight .set (calendar minutes, 0); Midnight .set (calendar. SECOND, 0); Midnight .set (calendar. MILLISECOND, 0); Long millisecondsmidart = system syntetime millis () - midnight Get Timinimis ();  

Comments

Popular posts from this blog

Eclipse CDT variable colors in editor -

AJAX doesn't send POST query -

wpf - Custom Message Box Advice -