SbTime(3)
π SbTime β NAME π
hiii bestie, welcome to SbTime(3) β this is the manual page for the SbTime class from Coin. The whole vibe: SbTime class instances represent time values. That's it, that's the girl. π
β¨ SYNOPSIS β¨
okay so first things first, you gotta pull her in:
#include <Inventor/SbTime.h>
π«Ά Public Member Functions π«Ά
SbTime (void)
SbTime (const double sec)
SbTime (const int32_t sec, const long usec)
SbTime (const struct timeval *const tv)
void setToTimeOfDay (void)
void setValue (const double sec)
void setValue (const int32_t sec, const long usec)
void setValue (const struct timeval *const tv)
void setMsecValue (const unsigned long msec)
double getValue (void) const
void getValue (time_t &sec, long &usec) const
void getValue (struct timeval *tv) const
unsigned long getMsecValue (void) const
SbString format (const char *const fmt='%S.%i') const
SbString formatDate (const char *const fmt=NULL) const
SbBool parsedate (const char *const date)
SbTime & operator+= (const SbTime &tm)
SbTime & operator-= (const SbTime &tm)
SbTime operator- (void) const
SbTime & operator*= (const double s)
SbTime & operator/= (const double s)
double operator/ (const SbTime &tm) const
SbTime operator% (const SbTime &tm) const
int operator== (const SbTime &tm) const
int operator!= (const SbTime &tm) const
SbBool operator< (const SbTime &tm) const
SbBool operator> (const SbTime &tm) const
SbBool operator<= (const SbTime &tm) const
SbBool operator>= (const SbTime &tm) const
void print (FILE *fp) const
π Static Public Member Functions π
static SbTime getTimeOfDay (void)
static SbTime zero (void)
static SbTime max (void)
static SbTime maxTime (void)
static void sleep (int msec)
π Detailed Description π
so, SbTime class instances represent time values. that's the whole point of her existence, no cap. β¨
SbTime is the convenient way of doing system independent representation and calculations on time values of high resolution. she's platform-agnostic and she ate. π
π§ Constructor & Destructor Documentation π§
SbTime::SbTime (void )
the default constructor sets up a time instance of 0 seconds. zero, nada, fresh start, main character energy. πΈ
SbTime::SbTime (const double sec)
constructs and initializes an SbTime instance to a time specified as sec seconds.
SbTime::SbTime (const int32_t sec, const long usec)
constructs and initializes an SbTime instance to a date and time of sec number of seconds and usec number of microseconds. precise queen. π
SbTime::SbTime (const struct timeval *const tv)
constructs and initializes an SbTime instance to the date and time given by the struct timeval. for the tea on the timeval structure, please consult your system developer documentation. iykyk. π¦
π₯ Member Function Documentation π₯
SbTime SbTime::getTimeOfDay (void ) [static]
returns an SbTime instance holding the current clock time. the current time comes at you as a particular number of seconds and microseconds since 00:00:00 January 1, 1970, in Coordinated Universal Time (UTC). iconic epoch behavior. β
See also: setToTimeOfDay().
void SbTime::setToTimeOfDay (void )
sets this SbTime to be the current clock time. the current time will be given as a particular number of seconds and microseconds since 00:00:00.00 1st January 1970.
See also: getTimeOfDay().
SbTime SbTime::zero (void ) [static]
returns an SbTime instance representing zero time.
See also: zero().
SbTime SbTime::max (void ) [static]
returns an SbTime instance representing the maximum representable time/date.
β οΈ this method is not available under Microsoft Windows, because max() crashes with a define macro Microsoft has polluted the global namespace with. not her fault, fr fr. π
See also: zero().
SbTime SbTime::maxTime (void ) [static]
returns an SbTime instance representing the maximum representable time/date.
See also: zero().
void SbTime::sleep (int msec) [static]
suspends the current thread for msec milliseconds. go take a nap bestie, you earned it. π
See also: cc_sleep().
Since: Coin 3.0
void SbTime::setValue (const double sec)
resets an SbTime instance to sec number of seconds.
See also: getValue().
void SbTime::setValue (const int32_t sec, const long usec)
resets an SbTime instance to sec number of seconds and usec number of microseconds.
See also: getValue().
void SbTime::setValue (const struct timeval *const tv)
resets an SbTime instance to the date and time given by the timeval struct. for the tea on the timeval struct, please consult your developer system documentation.
See also: getValue().
void SbTime::setMsecValue (const unsigned long msec)
sets the time by msec number of milliseconds.
See also: getMsecValue().
double SbTime::getValue (void ) const
returns time as number of seconds.
See also: setValue().
void SbTime::getValue (time_t & sec, long & usec) const
returns the number of seconds and microseconds which the SbTime instance represents.
See also: setValue().
void SbTime::getValue (struct timeval * tv) const
returns the time as a timeval structure. for the tea on the timeval structure, please consult your system developer documentation.
See also: setValue().
unsigned long SbTime::getMsecValue (void ) const
returns the number of milliseconds which the SbTime instance represents.
π¨ important note: you should in general avoid using this function, as it has an inherent API design flaw (from the original SGI Open Inventor design). the problem is that anunsigned longwraps around in a fairly short time when used for counting milliseconds: in less than 50 days. (and sinceSbTimeinstances are often initialized to be the time since the start of the epoch (i.e.1970-01-01 00:00), the value will have wrapped around many, many times.) she's giving cursed clock, lowkey. π
you are probably better off using the getValue() method which returns a double for the number of seconds, then multiply by 1000.0 if you need to know the current number of milliseconds of the SbTime instance.
See also: setMsecValue()
SbString SbTime::format (const char *const fmt = '%S.%i') const
uses the formatting specified below to return a string representation of the stored date/time. any format specifiers must be prefixed with a '' symbol, and any other text in the format string fmt will be copied directly to the resultant SbString. so cute, so customizable. π
%%β insert a single''.Dβ number of days.Hβ number of hours.hβ remaining hours after subtracting number of days.Mβ number of minutes.mβ remaining minutes after subtracting the total number of hours.Sβ number of seconds.sβ remaining seconds after subtracting the total number of minutes.Iβ number of milliseconds.iβ remaining milliseconds after subtracting the total number of seconds.Uβ number of microseconds.uβ remaining microseconds after subtracting the total number of mseconds.
the result shows UTC time, not corrected for local time zone nor daylight savings time. keep that in mind bestie. π
See also: formatDate().
SbString SbTime::formatDate (const char *const fmt = NULL) const
accepts the formatting identifiers specified by the POSIX strftime() function to return a string representation of the stored date. check your reference documentation for strftime() for the tea on the format modifiers available. β¨
default formatting is used if fmt is NULL. note that the default formatting is different on Microsoft Windows systems versus all other systems. for Windows, it is "%#c", and for other systems it is "%A, %D %r" (again, see system documentation on strftime() for more information).
the value of SbTime will be interpreted as seconds since 00:00:00 1970-01-01.
the result shows local time, according to local time zone and daylight savings time (if and when applicable). π¦
See also: format().
SbBool SbTime::parsedate (const char *const date)
this method takes a date string and converts it to the internal SbTime format. the date string must conform to one of three formats, namely the RFC 822 / RFC 1123 format (Wkd, DD Mnth YYYY HH:MM:SS GMT), the RFC 850 / RFC 1036 format (Weekday, DD-Mnth-YY HH:MM:SS GMT), or the asctime() format (Wkdy Mnth D HH:MM:SS YYYY).
feeding an invalid date string to this method will make it return FALSE. she said nope. π
SbTime & SbTime::operator+= (const SbTime & tm)
add tm to the time value and return a reference to self.
SbTime & SbTime::operator-= (const SbTime & tm)
subtract tm from the time value and return a reference to self.
SbTime SbTime::operator- (void ) const
return the negated time.
SbTime & operator*= (const double s)
multiply the time value with s and return a reference to self.
SbTime & operator/= (const double s)
divide the time value with s and return a reference to self.
double operator/ (const SbTime & tm) const
find the factor between this SbTime and the one given in tm, and return the result.
SbTime SbTime::operator% (const SbTime & tm) const
returns the remainder time when dividing on tm.
int SbTime::operator== (const SbTime & tm) const
check if the time value is equal to that of tm.
int SbTime::operator!= (const SbTime & tm) const
check if the time value is not equal to that of tm.
SbBool SbTime::operator< (const SbTime & tm) const
compares with tm and returns TRUE if less.
SbBool SbTime::operator> (const SbTime & tm) const
compares with tm and returns TRUE if larger than.
SbBool SbTime::operator<= (const SbTime & tm) const
compares with tm and returns TRUE if less or equal.
SbBool SbTime::operator>= (const SbTime & tm) const
compares with tm and returns TRUE if larger or equal.
void SbTime::print (FILE * fp) const
dumps the state of this object to the fp file stream. only works in the debug version of the library β the method does nothing in an optimized build. so if she's silent, that's why. π€«
π Author π
generated automatically by Doxygen for Coin from the source code. (yes, a robot wrote this and honestly? she served. π )
and that's the whole page bestie, you're officially an SbTime scholar πβ¨
Version 4.0.10 β dated Thu Jun 25 2026 00:00:00 β and that's the SbTime(3) page, periodt. π
π¦ where this page comes from
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 43: Coin4-devel 4.0.10-1.fc43 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- fedora 44: Coin4-devel 4.0.10-1.fc44 Β· BSD-3-Clause AND GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms