time_ adding extra time

BlitzMax Forums/BlitzMax Programming/time_ adding extra time

Kev(Posted 2008) [#1]
Hi Guys

Its been sometime since i fired up blitzmax, Im having a problem updating a time buffer

Local time:Byte[256],buff:Byte[256]
				
time_(time)
strftime_( buff,256,"%H:%M:%S - %d %b %Y",localtime_( time ));
				
Print "real time: "+CurrentTime()
Print "modifyed time: "+String.FromCString(buff)


I use the byte array time to store the time returned from calling time_, What i want to do is update the time array to contain a new time in the future by adding mins or hours to the array.

any help would be great, sorry but im having a brain dead day.

thanks
kev


Brucey(Posted 2008) [#2]
the tm struct looks like this :
              struct tm {
                      int     tm_sec;         /* seconds */
                      int     tm_min;         /* minutes */
                      int     tm_hour;        /* hours */
                      int     tm_mday;        /* day of the month */
                      int     tm_mon;         /* month */
                      int     tm_year;        /* year */
                      int     tm_wday;        /* day of the week */
                      int     tm_yday;        /* day in the year */
                      int     tm_isdst;       /* daylight saving time */
              };

... that which is returned by localtime()

time_t itself (as passed into localtime in your example), is an internal definition.