I have found DateTime.h thanks, however, there is still no reference there to the DateFormatType which is used in the DateToAcii funtion I have no idea how to set the formats or how to use them in the funtion. ----- Original Message ----- From: Dave Lippincott <[EMAIL PROTECTED]> To: Palm Developer Forum <[EMAIL PROTECTED]> Sent: Tuesday, June 27, 2000 2:42 PM Subject: Re: Time Manager Ch 28 Palm OS SDK Reference Questions > > 1) What are the DateFormatType types, ie what values can I enter here? > All of the date and time structure formats are in datetime.h > > > 2) Also what will be the size of pString? > How ever may bytes you allocated. I would suggest using the Date Time > constants in datetime.h > > > I beleive that this is referenced in DateTime.h but I cannot find > > DateTime.h. > Look in the support/Incs directory where the PalmOS API is installed > > > > > Note that the arguments to this function is Byte months, Byte Days,... > > If I use the function > > NoOfSeconds TimGetSecondsI(void) > > to get the seconds and then Use the function > > DateSecondsToDate(NoOfSeconds, DatePtr dateP) > > the date is stored in the dateP structure. > > Note that the variables for the dateP structure are Word year, Word month, > > Word day. These are variables of size Word, while the arguments for Date > to > > Aschii is of size Byte. > > In other words I cannot use > > TimGetSeconds > > DateSecondsToDate > > DateToAscii to give me the date becuase variables of dateP do not match > the > > arguments DateToAscii. > Yes you can. It works. > > > Also please not that there is no corresponding function TimSecondsToTime > to > > get the time. > Try TimSecondsToDateTime > > > > > If I use the function TimSecondsToDateTime because of missmatch of > variables > > and arguments as described above. > It works > > > > > 3)How can I get the current time > TimGetSeconds() > > > 4)How can I convert it to Ascii? > DateTimeType Now; > char TimeString[timeStringLength+1]; > char DateString[dateStringLength+1]; > SystemPReferecnesType SystemPrefs; > > PrefGetPreferences(&SystemPrefs); > TimSecondsToDateTime(TimGetSeconds(),&Now); > TimeToAscii(Now.hour,Now.minute,SystemPrefs.timeFormat,TimeString); > DateToAscii(Now.month,Now.day,Now.year,SystemPRefs.dateFormat,DateString); > > Viola! > > > > > -- > For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/ > > -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
