General Programming |
Author |
Message |
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Nov 29, 2006 4:12 pm Post subject: Date & Time |
|
|
Sue Loh: GetTickCount – Truth and Fiction
"GetTickCount is a pretty simple API from the caller’s perspective. Every
millisecond the tick count increments, and you can use GetTickCount to
retrieve the number of milliseconds since boot. Since GetTickCount
returns only a 32-bit number, after about 49 days, the counter wraps.
This is documented behavior, and to properly use GetTickCount you have
to understand that. Typically GetTickCount is used to time the duration
between two events, in which case you’re generally safe if you subtract
two values; subtraction is safe in the presence of rollover. (eg. If you get
a tick count of 0xFFFFFF00 before the rollover, and a tick count of 0x200
after the rollover, subtraction gives you a difference of 0x300 as expected.)" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Oct 22, 2007 5:54 pm Post subject: |
|
|
#include <DateTimeUtils.h> // Mac
DateTimeRec - Date, Time, and Measurement Utilities Reference
Code: | struct DateTimeRec {
short year;
short month;
short day;
short hour;
short minute;
short second;
short dayOfWeek;
};
typedef struct DateTimeRec DateTimeRec; |
dayOfWeek
"The day of the week, where 1 indicates Sunday and 7 indicates Saturday.
This field accepts 0, negative values, or values greater than 7. When you
use the SecondsToDate and DateToSeconds procedures, you get correct
values because this field is automatically calculated from the values in
the year, month, and day fields."
Last edited by delovski on Thu Oct 25, 2007 10:48 am; edited 1 time in total |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Oct 22, 2007 6:01 pm Post subject: |
|
|
#include <Winbase.h> // Win
SYSTEMTIME Structure - Win32 and COM Development>...>Time>Time Reference>Time Structures
Code: | typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME; |
wDayOfWeek
"The day of the week. This member can be one of the following values:
0 - Sunday, 1 - Monday, 2 - Tuesday, 3 - Wednesday, 4 - Thursday, 5 - Friday,
6 - Saturday" |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Wed Oct 31, 2007 7:05 pm Post subject: |
|
|
carbondev - Dates and Times
"The Mac OS has many APIs for manipulating dates and times. You might
want to avoid some of them because they are too old, and others because
they are too new. What follows is a brief overview of the main date / time
data types and compatibility notes about the APIs." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Sun Apr 06, 2008 11:19 am Post subject: |
|
|
JoS: 12-hour clock confusion
"I'm a U.S. citizen, born and bred. I allegedly learned to tell time in the
U.S. public (that's government run) school system, and I STILL can't keep
straight whether 12 am is noon or midnight." |
|
Back to top |
|
|
Ike Kapetan
Joined: 17 Jun 2006 Posts: 3146 Location: Europe
|
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Tue Mar 10, 2009 10:00 am Post subject: |
|
|
RC: Why is the Win32 epoch January 1, 1601?
"The Gregorian calendar operates on a 400-year cycle, and 1601 is the
first year of the cycle that was active at the time Windows NT was being
designed." |
|
Back to top |
|
|
delovski
Joined: 14 Jun 2006 Posts: 3524 Location: Zagreb
|
Posted: Mon Mar 29, 2010 1:22 am Post subject: |
|
|
SO - NSDate dateFromString, how to parse ‘around’ UTC, GMT and User
locale?
"I parse some values from an xml file.
There is a @"25-12-2010'T'23:40:00"string with the time and date and there
is a string with the GMT offset like this @"+0200". So the above time is the
25. of December 23:40:00 in timeZone +0200 GMT." |
|
Back to top |
|
|
|