You may try the following code.
void TimeToString (UInt32 numericDateTime, char* strDateTime)
{
 DateTimeType dateTime;

 Char *pDateString = MemPtrNew(9);
 Char *pTimeString = MemPtrNew(9);
  TimSecondsToDateTime (numericDateTime, &dateTime);
 DateToAscii (dateTime.month, dateTime.day, dateTime.year,
        dfDMYWithDashes, pDateString);
  TimeToAscii ( (UInt8)(dateTime.hour), (UInt8)(dateTime.minute),
         tfColon24h, pTimeString);
 StrCopy(strDateTime, pDateString);
 StrCat(strDateTime, " ");
 StrCat(strDateTime, pTimeString);

 MemPtrFree (pDateString);
 MemPtrFree (pTimeString);
 pDateString = NULL;
 pTimeString = NULL;
}


----- Original Message -----
From: "vanitha s" <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent: Tuesday, June 29, 2004 9:51 AM
Subject: Re: Converting Date to Text Field


> hi!
>
>   try out DateToAscii().check out this website
> http://www.fuw.edu.pl/~michalj/palmos/DateAndTimeManager.html#925005
> regards
> vanitha
>
>
>
> --- Matthew Horvat <[EMAIL PROTECTED]> wrote:
> > I have the following struct and populate it with the
> > following code.  My
> > question is how do i reference either the date or
> > time to get it into a text
> > control.  The DateToInt is throwing me off???
> >
> > typedef struct
> > {
> > UInt16 flags;
> > DateType date;
> > TimeType time;
> > }DBTele;
> >
> > //Unpack the record
> > record ->flags = *(UInt16*)ptr;
> > ptr += sizeof(record->flags);
> >
> > DateToInt(record->date) =*(UInt16*)ptr;
> > ptr += sizeof(record->date);
> >
> > TimeToInt(record->time) = *(UInt16*)ptr;
> > ptr += sizeof(record->time);
> >
> > If you need additional info, please let me know so i
> > can resolve this.
> >
> >
> _________________________________________________________________
> > FREE pop-up blocking with the new MSN Toolbar - get
> > it now!
> >
> http://toolbar.msn.click-url.com/go/onm00200415ave/direct/01/
> >
> >
> > --
> > For information on using the Palm Developer Forums,
> > or to unsubscribe, please see
> > http://www.palmos.com/dev/support/forums/
> >
>
>
>
>
> __________________________________
> Do you Yahoo!?
> Yahoo! Mail - Helps protect you from nasty viruses.
> http://promotions.yahoo.com/new_mail
>
> --
> For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/support/forums/

Reply via email to