Trivial Solutions
                    The LoseThos 64-bit PC Operating System
File:/LT/Demo/DateTime.CPZ
This, and all LoseThos files, are public domain.  Do whatever you like.
God is watching; God is just; God is never out-done in generosity.  He talks!

LoseThos code compiles with the 64-bit LoseThos compiler/assembler I wrote.
Boot the LoseThos CD and you can compile it.  Not in Kansas anymore!

Click here for preliminary compiler information you need.

/*
  An LTDate is a signed 64-bit date/time num
  representing how many 49710ths of a second
  since Christ.  The reason it is this crazy
  num is so that 32bits is exactly one day.

  These nums can be subtracted to get time
  differences.
 
  The time of day to the nearest 49710ths of a second
  is stored in the lower 32-bits.  The upper
  32-bits hold the num of days since Christ.

  PrintF() and the file datetimes use
  this format, otherwise you might want to
  use GetTimeStamp() for a higher frequency
  timing, divide by time_stamp_freq,
  but this num is tied to your CPU's
  clock frequency which is inexact when
  converted to real-time.
*/


LTDate d=GetCurTimeLTDate;

I64 i;
for (i=0;i<NUM_DATE_FMTS;i++)
  "%%h%dD: %h*D\n",i,i,d;
NewLine;

for (i=0;i<NUM_TIME_FMTS;i++)
  "%%h%dT: %h*T\n",i,i,d;

"$FG,PURPLE$LTDate freq:%12.6f$FG$\n",0x100000000/24.0/60.0/60.0;

/*
  You can customize to your locality
  with date_fmt_map[] and time_fmt_map[].
  DateTimeFmtMapsRst() will rst
  them.
*/

Historical capture: 2012-03-03. Home | Power on LoseThos | Sources and changes