DCMTK: dcmtk::log4cplus::helpers::Time Class Reference

DCMTK Version 3.6.9 OFFIS DICOM Toolkit

Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
dcmtk::log4cplus::helpers::Time Class Reference

This class represents a Epoch time with microsecond accuracy. More...

## Public Member Functions
time_t | sec () const
| Returns seconds value.
long | usec () const
| Returns microseconds value.
void | sec (time_t s)
| Sets the seconds value.
void | usec (long us)
| Sets the microseconds value.
time_t | setTime (tm *t)
| Sets this Time using the `mktime` function.
time_t | getTime () const DCMTK_LOG4CPLUS_ATTRIBUTE_PURE
| Returns this Time as a `time_t` value.
void | gmtime (tm *t) const
| Populates `tm` using the `gmtime()` function.
void | localtime (tm *t) const
| Populates `tm` using the `localtime()` function.
log4cplus::tstring | getFormattedTime (const log4cplus::tstring &fmt, bool use_gmtime=false) const
| Returns a string with a "formatted time" specified by `fmt`.

## Static Public Member Functions
static Time | gettimeofday ()
| Returns the current time using the `gettimeofday()` method if it is available on the current platform.

## Detailed Description

This class represents a Epoch time with microsecond accuracy.

## Member Function Documentation

## ◆ getFormattedTime()

log4cplus::tstring dcmtk::log4cplus::helpers::Time::getFormattedTime | ( | const log4cplus::tstring & | fmt,
|  | bool | use_gmtime = false ) const

Returns a string with a "formatted time" specified by `fmt`.

It used the `strftime()` function to do this.

Look at your platform's `strftime()` documentation for the formatting options available.

The following additional options are provided:
`q` - 3 character field that provides milliseconds `Q` - 7 character field that provides fractional milliseconds.

References getFormattedTime().

Referenced by getFormattedTime().

## ◆ gettimeofday()

static Time dcmtk::log4cplus::helpers::Time::gettimeofday | ( |  | ) |
| static

Returns the current time using the `gettimeofday()` method if it is available on the current platform.

(Not on WIN32.)

The documentation for this class was generated from the following file:

- oflog/include/dcmtk/oflog/helpers/timehelp.h

Generated on Sat Mar 1 2025 for DCMTK Version 3.6.9 by Doxygen 1.13.2