SBTIME(3iv)
๐ SbTime โ class for representation of a time ๐
okay bestie, pull up a chair, we're doing SbTime from the 3IV section of the manual, and it's genuinely iconic. no cap.
๐ธ NAME ๐ธ
SbTime โ class for representation of a time โฐโจ
๐ซถ INHERITS FROM ๐ซถ
SbTime โ yeah she inherits from herself, main character energy fr fr ๐
โจ SYNOPSIS โจ
#include <Inventor/SbTime.h>
Methods from class SbTime:
SbTime()
SbTime(double sec)
SbTime(int32_t sec, long usec)
SbTime(const struct timeval *tv)
static SbTime getTimeOfDay()
void setToTimeOfDay()
static SbTime zero()
static SbTime max()
void setValue(double sec)
void setValue(int32_t sec, long usec)
void setValue(const struct timeval *tv)
void setMsecValue(unsigned long msec)
double getValue() const
void getValue(int32_t &sec, long &usec) const
void getValue(struct timeval *tv) const
unsigned long getMsecValue() const
SbString format(const char *fmt = "%S.%i") const
SbString formatDate(const char *fmt = "%A, %D %r") const
SbTime operator +(const SbTime &t0, const SbTime &t1)
SbTime operator -(const SbTime &t0, const SbTime &t1)
SbTime & operator +=(const SbTime &tm)
SbTime & operator -=(const SbTime &tm)
SbTime operator -() const
SbTime operator *(double s, const SbTime &tm)
SbTime operator *(const SbTime &tm, double s)
SbTime operator /(const SbTime &tm, double s)
SbTime & operator *=(double s)
SbTime & operator /=(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
๐ DESCRIPTION ๐
so basically, this class represents time and does whole operations on it. and the way that you can work in seconds, or seconds and microseconds, or with a struct timeval (which is defined over in /usr/include/sys/time.h)?? versatile queen ๐โจ
๐ METHODS ๐
๐ฆ the constructors
SbTime()
SbTime(double sec)
SbTime(int32_t sec, long usec)
SbTime(const struct timeval *tv)
constructors that take seconds, or seconds and microseconds, or a struct timeval, pick your fighter ๐
NOTE, and this part MATTERS: an integer parameter will not automatically cast to adoubleto invoke the constructor taking seconds. like,SbTime(1)will result in a compilation error ๐ญ you have to writeSbTime(1.0)instead. this is deliberately to avoid errors in upgrading from an earlier release, in whichSbTime(1)had different semantics. in future releases this distinction will be eliminated, and the effect ofSbTime(1.0)and that ofSbTime(1)will be identical. iykyk.
๐ฐ๏ธ static SbTime getTimeOfDay()
get the current time (seconds since Jan 1, 1970). she knows what time it is, always ๐ซถ
๐ void setToTimeOfDay()
set to the current time (seconds since Jan 1, 1970).
0๏ธโฃ static SbTime zero()
get a zero time. nothing, nada, the void, but make it a class ๐
๐ static SbTime max()
get a time far, far into the future. like, unreasonably far. princess treatment timeline โจ
๐ void setValue(double sec)
set time from a double (in seconds).
๐ void setValue(int32_t sec, long usec)
set time from seconds + microseconds.
๐ void setValue(const struct timeval *tv)
set time from a struct timeval.
โก void setMsecValue(unsigned long msec)
set time from milliseconds.
๐ double getValue() const
get time in seconds as a double.
๐ void getValue(int32_t &sec, long &usec) const
get time in seconds and microseconds.
๐ void getValue(struct timeval *tv) const
get time in a struct timeval.
๐งฎ unsigned long getMsecValue() const
get time in milliseconds (for Xt). ok Xt representation we see you ๐
๐จ SbString format(const char *fmt = "%S.%i") const
convert to a string. the default format is seconds with 3 digits of fraction precision. fmt is a character string that consists of field descriptors and text characters, in a manner analogous to cftime (3C) and printf (3S). each field descriptor consists of a % character followed by another character which specifies the replacement for the field descriptor. all other characters are copied from fmt into the result. the following field descriptors are supported:
%โ the%characterDโ total number of daysHโ total number of hoursMโ total number of minutesSโ total number of secondsIโ total number of millisecondsUโ total number of microsecondshโ hours remaining after the days (00-23)mโ minutes remaining after the hours (00-59)sโ seconds remaining after the minutes (00-59)iโ milliseconds remaining after the seconds (000-999)uโ microseconds remaining after the seconds (000000-999999)
the uppercase descriptors are formatted with a leading โ for negative times; the lowercase descriptors are formatted fixed width, with leading zeros. for example, a reasonable format string might be "elapsed time: %M minutes, %s seconds". the default value of fmt, "%S.%i", formats the time as seconds with 3 digits of fractional precision. cute, precise, obsessed ๐
๐
SbString formatDate(const char *fmt = "%A, %D %r") const
convert to a date string, interpreting the time as seconds since Jan 1, 1970. the default format gives "Tuesday, 01/26/93 11:23:41 AM". see the cftime() reference page for explanation of the format string. calendar girlie behavior ๐๏ธ๐
โโ SbTime operator +(const SbTime &t0, const SbTime &t1) and SbTime operator -(const SbTime &t0, const SbTime &t1)
SbTime operator +(const SbTime &t0, const SbTime &t1)
SbTime operator -(const SbTime &t0, const SbTime &t1)
addition and subtraction of two times.
๐ SbTime & operator +=(const SbTime &tm) and SbTime & operator -=(const SbTime &tm)
SbTime & operator +=(const SbTime &tm)
SbTime & operator -=(const SbTime &tm)
addition and subtraction of two times which modifies the time structure. she's not copying, she's changing herself in place, character development ๐
๐ SbTime operator -() const
unary negation.
โ๏ธโ operator *(double s, const SbTime &tm), operator *(const SbTime &tm, double s), operator /(const SbTime &tm, double s)
SbTime operator *(double s, const SbTime &tm)
SbTime operator *(const SbTime &tm, double s)
SbTime operator /(const SbTime &tm, double s)
multiplication and division by scalar.
๐ฅ SbTime & operator *=(double s) and SbTime & operator /=(double s)
SbTime & operator *=(double s)
SbTime & operator /=(double s)
destructive multiplication and division by scalar. yes bestie, destructive, she goes in and rearranges her own furniture ๐ซฃ
๐ฐ double operator /(const SbTime &tm) const
division by another time.
๐ข SbTime operator %(const SbTime &tm) const
modulus for two times (remainder when time1 is divided by time2).
โ๏ธ int operator ==(const SbTime &tm) const and int operator !=(const SbTime &tm) const
int operator ==(const SbTime &tm) const
int operator !=(const SbTime &tm) const
equality operators. are y'all the same or not, let's find out ๐
๐ operator <, operator >, operator <=, operator >=
SbBool operator <(const SbTime &tm) const
SbBool operator >(const SbTime &tm) const
SbBool operator <=(const SbTime &tm) const
SbBool operator >=(const SbTime &tm) const
relational operators. comparing eras, lowkey ๐ธ
๐ SEE ALSO ๐
cftime
okay that's the whole thing, bestie, you're officially fluent in SbTime ๐ this was the SbTime(3IV) page, section 3IV, and honestly? she ate. no date on this one, just pure timeless class energy โฐโจ๐
bye pookie ๐ซถ
๐ฆ where this page comes from
- debian bookworm: inventor-doc 2.1.5-10+dfsg-2 ยท LGPL-2.0-or-later
- debian trixie: inventor-doc 2.1.6+ds-2 ยท LGPL-2.0-or-later
- ubuntu jammy: inventor-doc 2.1.5-10-24
- ubuntu noble: inventor-doc 2.1.5-10+dfsg-2.1build2 ยท LGPL-2.0-or-later
- ubuntu questing: inventor-doc 2.1.6+ds-2
- ubuntu resolute: inventor-doc 2.1.6.1+ds-1 ยท LGPL-2.0-or-later
- ubuntu stonking: inventor-doc 2.1.6.1+ds-1 ยท LGPL-2.0-or-later
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms