Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
Time Conversions

A comprehensive set of functions and utilities for working with timestamps and time-related data. More...

Topics

 Time Zone Conversions
 Helpers for converting supported regional time zones and UTC in MQL5.
 Time structure conversions

Functions

datetime time_shield::cet_to_gmt (const datetime cet)
 Convert Central European Time to Greenwich Mean Time.
datetime time_shield::eet_to_gmt (const datetime eet)
 Convert Eastern European Time to Greenwich Mean Time.
datetime time_shield::gmt_to_cet (const datetime gmt)
 Convert GMT to Central European Time.
datetime time_shield::gmt_to_eet (const datetime gmt)
 Convert GMT to Eastern European Time.
datetime time_shield::et_to_gmt (const datetime et)
 Convert US Eastern Time to GMT.
datetime time_shield::gmt_to_et (const datetime gmt)
 Convert GMT to US Eastern Time.
datetime time_shield::ny_to_gmt (const datetime ny)
 Convert New York Time to GMT.
datetime time_shield::gmt_to_ny (const datetime gmt)
 Convert GMT to New York Time.
datetime time_shield::ct_to_gmt (const datetime ct)
 Convert US Central Time to GMT.
datetime time_shield::gmt_to_ct (const datetime gmt)
 Convert GMT to US Central Time.
datetime time_shield::zone_to_gmt (const datetime local, const TimeZone zone)
 Convert supported local civil time to GMT.
datetime time_shield::gmt_to_zone (const datetime gmt, const TimeZone zone)
 Convert GMT to a supported local civil time zone.
datetime time_shield::convert_time_zone (const datetime local, const TimeZone from, const TimeZone to)
 Convert a timestamp between two supported local civil time zones.

Detailed Description

A comprehensive set of functions and utilities for working with timestamps and time-related data.

This module provides functionalities to convert, manipulate, and analyze timestamps in seconds, milliseconds, and floating-point formats. It also includes utilities for working with date-time structures, UNIX days, and various time units (hours, minutes, seconds, etc.).

Key Features:

  • Convert timestamps between seconds, milliseconds, and floating-point seconds.
  • Extract components such as nanoseconds, microseconds, and milliseconds from timestamps.
  • Convert timestamps to and from date-time structures.
  • Calculate the start and end of various time intervals (e.g., days, hours, months, years).
  • Analyze time data (e.g., day of the week, day of the year, days in a month or year).

Usage Examples:

Function Documentation

◆ cet_to_gmt()

datetime time_shield::cet_to_gmt ( const datetime cet)

Convert Central European Time to Greenwich Mean Time.

Definition at line 251 of file time_zone_conversions.mqh.

◆ convert_time_zone()

datetime time_shield::convert_time_zone ( const datetime local,
const TimeZone from,
const TimeZone to )

Convert a timestamp between two supported local civil time zones.

Definition at line 390 of file time_zone_conversions.mqh.

◆ ct_to_gmt()

datetime time_shield::ct_to_gmt ( const datetime ct)

Convert US Central Time to GMT.

Definition at line 304 of file time_zone_conversions.mqh.

◆ eet_to_gmt()

datetime time_shield::eet_to_gmt ( const datetime eet)

Convert Eastern European Time to Greenwich Mean Time.

Definition at line 257 of file time_zone_conversions.mqh.

◆ et_to_gmt()

datetime time_shield::et_to_gmt ( const datetime et)

Convert US Eastern Time to GMT.

Definition at line 275 of file time_zone_conversions.mqh.

◆ gmt_to_cet()

datetime time_shield::gmt_to_cet ( const datetime gmt)

Convert GMT to Central European Time.

Definition at line 263 of file time_zone_conversions.mqh.

◆ gmt_to_ct()

datetime time_shield::gmt_to_ct ( const datetime gmt)

Convert GMT to US Central Time.

Definition at line 310 of file time_zone_conversions.mqh.

◆ gmt_to_eet()

datetime time_shield::gmt_to_eet ( const datetime gmt)

Convert GMT to Eastern European Time.

Definition at line 269 of file time_zone_conversions.mqh.

◆ gmt_to_et()

datetime time_shield::gmt_to_et ( const datetime gmt)

Convert GMT to US Eastern Time.

Definition at line 283 of file time_zone_conversions.mqh.

◆ gmt_to_ny()

datetime time_shield::gmt_to_ny ( const datetime gmt)

Convert GMT to New York Time.

Definition at line 298 of file time_zone_conversions.mqh.

◆ gmt_to_zone()

datetime time_shield::gmt_to_zone ( const datetime gmt,
const TimeZone zone )

Convert GMT to a supported local civil time zone.

Definition at line 353 of file time_zone_conversions.mqh.

◆ ny_to_gmt()

datetime time_shield::ny_to_gmt ( const datetime ny)

Convert New York Time to GMT.

Definition at line 292 of file time_zone_conversions.mqh.

◆ zone_to_gmt()

datetime time_shield::zone_to_gmt ( const datetime local,
const TimeZone zone )

Convert supported local civil time to GMT.

Definition at line 316 of file time_zone_conversions.mqh.