Time Shield Library
C++ library for working with time
Loading...
Searching...
No Matches
time_formatting.mqh File Reference

Header with helper functions for formatting timestamps and date-time values in MQL5. More...

Go to the source code of this file.

Namespaces

namespace  time_shield
 Main namespace for the Time Shield library.
 

Macros

#define __TIME_SHIELD_TIME_FORMATTING_MQH__
 

Functions

string time_shield::pad_int (int value, int width)
 Internal helper to pad integer with leading zeros.
 
void time_shield::process_format_impl (const char last_char, int repeat_count, long ts, int utc_offset, const DateTimeStruct &dt, string &result)
 Internal helper for custom formatting processing.
 
string time_shield::to_string (const string &format_str, long timestamp, int utc_offset=0)
 Convert timestamp to string with custom format.
 
string time_shield::to_str (const string &format_str, long timestamp, int utc_offset=0)
 Alias for to_string.
 
string time_shield::to_string_ms (const string &format_str, long timestamp_ms, int utc_offset=0)
 Convert millisecond timestamp to string with custom format.
 
string time_shield::to_str_ms (const string &format_str, long timestamp_ms, int utc_offset=0)
 Alias for to_string_ms.
 
string time_shield::to_iso8601 (long ts)
 Convert timestamp to ISO8601 string.
 
string time_shield::to_iso8601_ms (long ts_ms)
 Convert millisecond timestamp to ISO8601 string.
 
string time_shield::to_iso8601_date (long ts)
 Convert timestamp to ISO8601 date string.
 
string time_shield::to_iso8601_time (long ts)
 Convert timestamp to ISO8601 time string.
 
string time_shield::to_iso8601_time_ms (long ts_ms)
 Convert millisecond timestamp to ISO8601 time string.
 
string time_shield::to_iso8601_utc (long ts)
 Convert timestamp to ISO8601 string in UTC.
 
string time_shield::to_iso8601_utc_ms (long ts_ms)
 Convert millisecond timestamp to ISO8601 string in UTC.
 
string time_shield::to_iso8601 (long ts, int utc_offset)
 Convert timestamp to ISO8601 string with timezone offset.
 
string time_shield::to_iso8601_ms (long ts_ms, int utc_offset)
 Convert millisecond timestamp to ISO8601 string with timezone offset.
 
string time_shield::to_mql5_date_time (long ts)
 Convert timestamp to MQL5 date-time string.
 
string time_shield::to_mql5_date (long ts)
 Convert timestamp to MQL5 date string.
 
string time_shield::to_mql5_time (long ts)
 Convert timestamp to MQL5 time string.
 
string time_shield::to_mql5_full (long ts)
 Alias for to_mql5_date_time.
 
string time_shield::to_windows_filename (long ts)
 Convert timestamp to Windows-compatible filename.
 
string time_shield::to_windows_filename_ms (long ts_ms)
 Convert millisecond timestamp to Windows-compatible filename.
 
string time_shield::to_human_readable (long ts)
 Convert timestamp to human-readable string.
 
string time_shield::to_human_readable_ms (long ts_ms)
 Convert millisecond timestamp to human-readable string.
 

Detailed Description

Header with helper functions for formatting timestamps and date-time values in MQL5.

This file provides functions for converting timestamps to various string representations including ISO8601 and MQL5 specific formats.

Definition in file time_formatting.mqh.

Macro Definition Documentation

◆ __TIME_SHIELD_TIME_FORMATTING_MQH__

#define __TIME_SHIELD_TIME_FORMATTING_MQH__

Definition at line 8 of file time_formatting.mqh.