File utctime.h
Go to the source code of this file
#include "General.h"
#include "ReadInput.h"
Public Functions
Type | Name |
---|---|
double | date_string_to_s (std::string datetime, std::string refdate) Convert a date string to seconds from a reference date. Converts a date string in the format "YYYY-MM-DDTHH:MM:SS" or "YYYY/MM/DD HH:MM:SS" to seconds from the reference date. |
long long | date_string_to_time (std::string date) Convert a date string to a Unix timestamp. Converts a date string in the format "YYYY-MM-DDTHH:MM:SS" or "YYYY/MM/DD HH:MM:SS" to a Unix timestamp (number of seconds since the beginning of 1970 CE). |
double | readinputtimetxt (std::string input, std::string & refdate) Read a time string and convert it to seconds. Reads a time string and converts it to seconds. If the string is a valid datetime string it returns the seconds from the reference date, otherwise it returns a float of seconds. |
bool | testime1 (int hour) Test time calculation functions. Test time calculation functions. |
bool | testime2 (int hour) Test time calculation functions for greater than comparison. Test time calculation functions for greater than comparison. |
Public Functions Documentation
function date_string_to_s
Convert a date string to seconds from a reference date. Converts a date string in the format "YYYY-MM-DDTHH:MM:SS" or "YYYY/MM/DD HH:MM:SS" to seconds from the reference date.
Parameters:
datetime
The date string to convertrefdate
The reference date string
Returns:
The number of seconds from the reference date as double
function date_string_to_time
Convert a date string to a Unix timestamp. Converts a date string in the format "YYYY-MM-DDTHH:MM:SS" or "YYYY/MM/DD HH:MM:SS" to a Unix timestamp (number of seconds since the beginning of 1970 CE).
Parameters:
date
The date string to convert
Returns:
The corresponding Unix timestamp as long long
function readinputtimetxt
Read a time string and convert it to seconds. Reads a time string and converts it to seconds. If the string is a valid datetime string it returns the seconds from the reference date, otherwise it returns a float of seconds.
Parameters:
input
The input time stringrefdate
The reference date string
Returns:
The time in seconds as double
function testime1
Test time calculation functions. Test time calculation functions.
Parameters:
hour
The hour to test
function testime2
Test time calculation functions for greater than comparison. Test time calculation functions for greater than comparison.
Parameters:
hour
The hour to test
The documentation for this class was generated from the following file src/utctime.h