Standard system time functions.
This module contains standard time functions and formatters for printing. Note that Pebble now supports both local time and UTC time (including timezones and daylight savings time). Most of these functions are part of the C standard library which is documented at https://sourceware.org/newlib/libc.html#Timefns
Format the time value at tm according to fmt and place the result in a buffer s of size max.
A preallocation char array of size max
the size of the array s
a formatting string
A pointer to a struct tm containing a broken out time value
The number of bytes placed in the array s, not including the null byte, 0 if the value does not fit.
convert the time value pointed at by clock to a struct tm which contains the time adjusted for the local timezone
A pointer to an object of type time_t that contains a time value
A pointer to a struct tm containing the broken out time value adjusted for the local timezone
convert the time value pointed at by clock to a struct tm which contains the time expressed in Coordinated Universal Time (UTC)
A pointer to an object of type time_t that contains a time value
A pointer to a struct tm containing Coordinated Universal Time (UTC)
Obtain the number of seconds since epoch. Note that the epoch is not adjusted for Timezones and Daylight Savings.
Optionally points to an address of a time_t variable to store the time in. If you only want to use the return value, you may pass NULL into tloc instead
The number of seconds since epoch, January 1st 1970
Obtain the number of seconds elapsed between beginning and end represented as a double.
Pebble uses software floating point emulation. Including this function which returns a double will significantly increase the size of your binary. We recommend directly subtracting both timestamps to calculate a time difference.
int difference = ts1 - ts2;
A time_t variable representing some number of seconds since epoch, January 1st 1970
A time_t variable representing some number of seconds since epoch, January 1st 1970. Note that end should be greater than beginning, but this is not enforced.
The number of seconds elapsed between beginning and end.
Obtain the number of seconds and milliseconds part since the epoch. This is a non-standard C function provided for convenience.
Optionally points to an address of a time_t variable to store the time in. You may pass NULL into tloc if you don't need a time_t variable to be set with the seconds since the epoch
Optionally points to an address of a uint16_t variable to store the number of milliseconds since the last second in. If you only want to use the return value, you may pass NULL into out_ms instead
The number of milliseconds since the last second
Return the UTC time that corresponds to the start of today (midnight).
the UTC time corresponding to the start of today (midnight)
time in seconds since the epoch, January 1st 1970
Do you have questions about the Pebble SDK?
Do you need some help understanding something on this page?
You can either take advantage of our awesome developer community and check out the SDK Help forums, or you can send us a message through the website!