Menu

#1 DosGetDateTime returning timezone

closed
nobody
None
5
2005-01-26
2005-01-04
No

In os2linux.h:

aires@bossanova C $ diff -uprN os2linux/os2linux.h
~/os2linux/os2/os2linux.h
--- os2linux/os2linux.h 2005-01-04 15:56:52.007094264 -0200
+++ /home/aires/os2linux/os2/os2linux.h 2005-01-04
15:03:04.495750568 -0200
@@ -59,9 +59,6 @@
#include <nl_types.h>
#include <curses.h>

-#include <getopt.h>
-#include <sys/types.h>
-

/*----------------------------------------------------------------------------*/
/* Definitions
*/

In datetime.c:

aires@bossanova C $ diff -uprN os2linux/datetime.c
~/os2linux/os2/datetime.c
--- os2linux/datetime.c 2005-01-04 15:43:12.552670272 -0200
+++ /home/aires/os2linux/os2/datetime.c 2005-01-04
15:03:04.247788264 -0200
@@ -45,7 +45,6 @@
/* DosGetDateTime
*/
/* Notes:
*/
/* - the timezone is always returned as unknown
*/
-/* * Fixed by Fernando Aires, LTC-IBM Brazil
(faires@br.ibm.com)
/*----------------------------------------------------------------------------*/

APIRET APIENTRY DosGetDateTime(PDATETIME pdt)
@@ -57,7 +56,6 @@ APIRET APIENTRY DosGetDateTime(PDATETIME
/* get the current time and convert it */
gettimeofday(&now, NULL);
localtime_r(&now.tv_sec, &brokentime);
- tzset(); /* Set TimeZone defined by /etc/localhost */

/* now set the return values */
pdt->hours = (UCHAR)brokentime.tm_hour;
@@ -67,7 +65,7 @@ APIRET APIENTRY DosGetDateTime(PDATETIME
pdt->day = (UCHAR)brokentime.tm_mday;
pdt->month = (UCHAR)brokentime.tm_mon + 1;
pdt->year = (USHORT)brokentime.tm_year + 1900;
- pdt->timezone = timezone/(-60) /* fixed! */
+ pdt->timezone = 0; /* fix this! */
pdt->weekday = (UCHAR)brokentime.tm_wday;

RESTOREENV_RETURN(NO_ERROR);

Discussion

  • David Ashley

    David Ashley - 2005-01-26
    • status: open --> closed
     
  • David Ashley

    David Ashley - 2005-01-26

    Logged In: YES
    user_id=931756

    Applied.