(C) 1998 AROS - The Amiga Research OS
\begin{description} \item{dat_Stamp} The datestamp to convert to ascii
\item{dat_Format} How to convert the datestamp into dat_StrDate. Can be any of the following:
\begin{description}
\item{FORMAT_DEF} default format for locale.
\end{description}
\item{dat_Flags} Modifies dat_Format. The only flag used by this function is DTF_SUBST. If set, then a string like "Today" or "Monday" is generated instead of the normal format if possible.
\item{dat_StrDay} Pointer to a buffer to receive the day of the week string. (Monday, Tuesday, etc.). If null, this string will not be generated.
\item{dat_StrDate} Pointer to a buffer to receive the date string, in the format requested by dat_Format, subject to possible modifications by DTF_SUBST. If null, this string will not be generated.
\item{dat_StrTime} Pointer to a buffer to receive the time of day string. If NULL, this will not be generated.
\end{description}
# include# include # undef AROS_LH1 # undef DateToStr # undef AROS_LHA # define AROS_LH1(ret,name,arg,type,base,offset,libname) \ ret name (arg) # define AROS_LHA(type,name,reg) type name # include # include # include int main (int argc, char ** argv) { struct DateTime curr; char day[LEN_DATSTRING]; char time[LEN_DATSTRING]; char date[LEN_DATSTRING]; DateStamp (&curr.dat_Stamp); curr.dat_Format = FORMAT_DOS; curr.dat_Flags = 0; curr.dat_StrDay = day; curr.dat_StrDate = date; curr.dat_StrTime = time; DateToStr (&curr); printf ("Today is %s, %s. It's %s\n" , day , date , time ); curr.dat_Format = FORMAT_DEF; DateToStr (&curr); printf ("Local date: %s\n", date); curr.dat_Flags = DTF_SUBST; DateToStr (&curr); printf ("Date with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days ++; DateToStr (&curr); printf ("Date +1 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days ++; DateToStr (&curr); printf ("Date +2 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days ++; DateToStr (&curr); printf ("Date +3 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days -= 4; DateToStr (&curr); printf ("Date -1 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days --; DateToStr (&curr); printf ("Date -2 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days --; DateToStr (&curr); printf ("Date -3 with DTF_SUBST: %s\n", date); curr.dat_Stamp.ds_Days = 0; curr.dat_Stamp.ds_Minute = 0; curr.dat_Stamp.ds_Tick = 0; DateToStr (&curr); printf ("First Date: %s, %s. Time: %s\n", day, date, time); curr.dat_Stamp.ds_Days = 0; curr.dat_Stamp.ds_Minute = 1; curr.dat_Stamp.ds_Tick = 0; DateToStr (&curr); printf ("First Date + 1 Minute: %s, %s. Time: %s\n", day, date, time); curr.dat_Stamp.ds_Days = 0; curr.dat_Stamp.ds_Minute = 0; curr.dat_Stamp.ds_Tick = 153; DateToStr (&curr); printf ("First Date + 153 Ticks: %s, %s. Time: %s\n", day, date, time); curr.dat_Stamp.ds_Days = 1; curr.dat_Stamp.ds_Minute = 0; curr.dat_Stamp.ds_Tick = 0; DateToStr (&curr); printf ("First Date: %s, %s. Time: %s\n", day, date, time); return 0; } /* main */