MCPcopy Create free account
hub / github.com/HaxeFoundation/hxcpp / __hxcpp_timezone_offset

Function __hxcpp_timezone_offset

src/hx/Date.cpp:358–371  ·  view source on GitHub ↗

* for the input Epoch time, returns the correct timezone offset of local time zone; * return value is in seconds e.g. -28800 (that would be -8 hrs) */

Source from the content-addressed store, hash-verified

356 * return value is in seconds e.g. -28800 (that would be -8 hrs)
357 */
358double __hxcpp_timezone_offset(double inSeconds)
359{
360 struct tm localTime;
361 __internal_localtime( inSeconds, &localTime);
362
363 #if defined(HX_WINDOWS) || defined(__SNC__) || defined(__ORBIS__)
364 struct tm gmTime;
365 __internal_gmtime(inSeconds, &gmTime );
366
367 return mktime(&localTime) - mktime(&gmTime);
368 #else
369 return localTime.tm_gmtoff;
370 #endif
371}
372
373String __internal_to_string(struct tm time)
374{

Callers 1

__hxcpp_from_utcFunction · 0.85

Calls 2

__internal_localtimeFunction · 0.85
__internal_gmtimeFunction · 0.85

Tested by

no test coverage detected