[Openroad-users] WindowsAPI call to GetLocalTime

Bill Allan wgallan at tpg.com.au
Mon Apr 21 19:09:46 EST 2008


Can I ask a stupid question?

Why do you need to use 'GetLocalTime'?   Ingres DATE_GMT(DATE('now')) will give you a GMT ( UTC) string that can be cut up and give you all the information apart from the Milliseconds component.

In Ingres 2006 there is a new ANSI DATE data type which has a number of good features.  Here is part of the doco:

TIME WITH TIME ZONE hh:mm:ss.ffff... [+|-]th:tm 12:45:12.23456 -05:00
TIME or TIME WITHOUT TIME ZONE hh:mm:ss.ffff... 12:45:12.23456
other formats are:
ANSIDATE
TIME WITH LOCAL TIME ZONE 
TIMESTAMP WITH TIME ZONE 
TIMESTAMP or TIMESTAMP WITHOUT TIME ZONE
TIMESTAMP WITH LOCAL TIME ZONE
INTERVAL YEAR TO MONTH
INTERVAL DAY TO SECOND
Having the Timezone with ANSI DATE just tells you what the offset from GMT isat that instant. It doesn't tell you the timezone name.

Bill Allan.

----- Original Message ----- 

  From: jade clements 
  To: OpenRoad Users Group 
  Sent: Monday, April 21, 2008 12:18 PM
  Subject: [Openroad-users] WindowsAPI call to GetLocalTime


  Hello,

   

  I'm using a Window's API call, GetLocalTime, to obtain the user's pc time however I'm getting some weird results.

   

  procedure zGetTime ( ) =

  declare

      wYear = INTEGER NOT NULL;

      wMonth = INTEGER NOT NULL;

      wDayOfWeek = INTEGER NOT NULL;

      wDay = INTEGER NOT NULL;

      wHour = INTEGER NOT NULL;

      wMinute = INTEGER NOT NULL;

      wSecond = INTEGER NOT NULL;

      wMilliseconds = INTEGER NOT NULL;

   

  enddeclare

  {

      CALLPROC GetLocalTime(

          byref(wYear), 

          byref(wMonth), 

          byref(wDayOfWeek), 

          byref(wDay), 

          byref(wHour), 

          byref(wMinute), 

          byref(wSecond), 

          byref(wMilliseconds));

   

  CurProcedure.TRACE(

      'Year: ' + VARCHAR(wYear) + 

      ' Mth: ' + VARCHAR(wMonth) + 

      ' Day: ' + VARCHAR(wDay) + 

      ' Hr: ' + VARCHAR(wHour) + 

      ' Min: ' + VARCHAR(wMinute) + 

      ' Sec: ' + VARCHAR(wSecond) + 

      ' DOW: ' + VARCHAR(wDayOfWeek)); 

  }

   

   

  Result:

  Year: 264152 Mth: 1376257 Day: 45023240 Hr: 0 Min: 0 Sec: 0 DOW: 917516

   

  The Day value changes everytime the procedure is run.

   

  The API guide mentions that the GetSystemTime function returns the system time expressed in Coordinated Universal Time (UTC).  I guess the same goes for GetLocalTime however, the return values just aren't right.

   

   

  Can anyone help?

   

   

   

  Regards

  Jade Clements

   



   

  MyWorkplace Solutions Pty Limited

  Level 5, 11 Queens Road

  Melbourne Victoria 3004

   

   

  Ph:  1300 733 731

  Making Service our Priority

   

  www.MyWorkplace.com.au

   

  If you receive this email by mistake, please notify us and do not make any use of the email. We do not waive any privilege, confidentiality or copyright associated with it.

   

   



------------------------------------------------------------------------------


  ________________________________________________________________
  OpenROAD-Users mailing list

  You can maintain your subscription here:
  http://www.peerlessit.com/mailman/listinfo/openroad-users

  To unsubscribe click on this link
  mailto:openroad-users-unsubscribe at peerlessit.com&subject=unsubscribe

  To subscribe click on this link
  mailto:openroad-users-subscribe at peerlessit.com&subject=subscribe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.peerlessit.com/pipermail/openroad-users/attachments/20080421/2b20f098/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1436 bytes
Desc: not available
Url : http://www.peerlessit.com/pipermail/openroad-users/attachments/20080421/2b20f098/attachment.jpe 


More information about the Openroad-users mailing list