# TCCDateTime_Functions

#### Purpose

This module supports date and time handling

#### Module Parameters

-

#### Module depends on

-

Summary

TCCDateTime_Functions | This module supports date and time handling
Functions |
f_time | Current calendar time of the system in seconds
f_ctime | Convert a time value in seconds to human readable string The time represented as local time
f_ctime_UTC | Convert a time value in seconds to human readable string The time represented as UTC
f_getTimeFormatted | Return the current calendar time in a formatted way
f_time2sec | function to convert a formated time value to seconds The time represented as local time
f_time2sec_UTC | function to convert a formated time value to seconds The time represented as UTC
f_getCurrentDateWithOffset | Generate a date from the actual date and time plus the parameter in seconds e.g.
f_getCurrentGMTDate | Return the current GMT date in format RFC 1123-Date ex :Sat, 13 Nov 2010 23:30:02 GMT
f_tic | Return the number of clock ticks used by the application since the program was launched
f_toc | Elapsed seconds since time t (only when f_tic() returns the number of clock ticks elapsed since the program was launched)
f_timeDiff | Difference between two time

### Functions

### f_time

> external function f_time() return integer

#### Purpose

Current calendar time of the system in seconds

#### Parameters

-

#### Return Value

integer | time value

#### Errors

-

#### Detailed description

-

### f_ctime

> external function f_ctime( | integer | pl_sec | ) return charstring

#### Purpose

Convert a time value in seconds to human readable string The time represented as local time

#### Parameters

pl_sec | in integer - time value

#### Return Value

integer | converted time value

#### Errors

-

#### Detailed description

-

### f_ctime_UTC

> external function f_ctime_UTC( | integer | pl_sec | ) return charstring

#### Purpose

Convert a time value in seconds to human readable string The time represented as UTC

#### Parameters

pl_sec | in integer - time value

#### Return Value

integer | converted time value

#### Errors

-

#### Detailed description

-

### f_getTimeFormatted

> external function f_getTimeFormatted( | integer | pl_sec,
> | charstring | pl_format | ) return charstring

#### Purpose

Return the current calendar time in a formatted way

#### Parameters

pl_sec | in integer - time value in seconds
pl_format | in charstring - format string

#### Return Value

charstring | formatted time in string format

#### Errors

-

#### Detailed description

Specifier / Replaced by / Example

%a | Abbreviated weekday name * - Thu
%A | Full weekday name * - Thursday
%b | Abbreviated month name * - Aug
%B | Full month name * - August
%c | Date and time representation * - Thu Aug 23 14:55:02 2001
%d | Day of the month (01-31) - 23
%H | Hour in 24h format (00-23) - 14
%I | Hour in 12h format (01-12) - 02
%j | Day of the year (001-366) - 235
%m | Month as a decimal number (01-12) - 08
%M | Minute (00-59) - 55
%p | AM or PM designation - PM
%S | Second (00-61) - 02
%U | Week number with the first Sunday as the first day of week one (00-53) - 33
%w | Weekday as a decimal number with Sunday as 0 (0-6) - 4
%W | Week number with the first Monday as the first day of week one (00-53) - 34
%x | Date representation * - 08/23/01
%X | Time representation * - 14:55:02
%y | Year, last two digits (00-99) - 01
%Y | Year - 2001
%Z | Timezone name or abbreviation - CDT
%% | A % sign - %

- The specifiers whose description is marked with an asterisk (*) are locale-dependent.

### f_time2sec

> external function f_time2sec( | integer | pl_year,
> | integer | pl_mon,
> | integer | pl_day,
> | integer | pl_hour,
> | integer | pl_min,
> | integer | pl_sec | ) return integer

#### Purpose

function to convert a formated time value to seconds The time represented as local time

#### Parameters

pl_year | in integer - year (e.g. 2007)
pl_mon | in integer - month (e.g. 3)
pl_day | in integer - day (e.g. 7)
pl_hour | in integer - day (e.g. 12)
pl_min | in integer - day (e.g. 50)
pl_sec | in integer - day (e.g. 7)

#### Return Value

integer | time in seconds

#### Errors

-

#### Detailed description

time in seconds since January 1, 1900

### f_time2sec_UTC

> external function f_time2sec_UTC( | integer | pl_year,
> | integer | pl_mon,
> | integer | pl_day,
> | integer | pl_hour,
> | integer | pl_min,
> | integer | pl_sec | ) return integer

#### Purpose

function to convert a formated time value to seconds The time represented as UTC

#### Parameters

pl_year | in integer - year (e.g. 2007)
pl_mon | in integer - month (e.g. 3)
pl_day | in integer - day (e.g. 7)
pl_hour | in integer - day (e.g. 12)
pl_min | in integer - day (e.g. 50)
pl_sec | in integer - day (e.g. 7)

#### Return Value

integer | time in seconds

#### Errors

-

#### Detailed description

time in seconds since January 1, 1900

### f_getCurrentDateWithOffset

> external function f_getCurrentDateWithOffset( | integer | pl_sec | ) return charstring

#### Purpose

Generate a date from the actual date and time plus the parameter in seconds e.g. getSdate(30) will return a charstring containing the date and time of 30 seconds later

#### Parameters

pl_sec | in integer - offset time value

#### Return Value

charstring | formatted time in string format

#### Errors

-

#### Detailed description

-

### f_getCurrentGMTDate

> external function f_getCurrentGMTDate() return charstring

#### Purpose

Return the current GMT date in format RFC 1123-Date ex :Sat, 13 Nov 2010 23:30:02 GMT

#### Parameters

-

#### Return Value

charstring | formatted time in string format

#### Errors

-

#### Detailed description

-

### f_tic

> external function f_tic() return integer

#### Purpose

Return the number of clock ticks used by the application since the program was launched

OR

Return the amount of CPU time in microseconds since the last call of f_tic

OR ...

Warning! This function depends on used library version. Be careful!

#### Parameters

-

#### Return Value

integer | tics since program start

#### Errors

-

#### Detailed description

-

### f_toc

> external function f_toc( | integer | t | ) return float

#### Purpose

Elapsed seconds since time t (only when f_tic() returns the number of clock ticks elapsed since the program was launched)

Warning! This function depends on used library version. Be careful!

#### Parameters

t | in integer - time value

#### Return Value

float | elapsed seconds

#### Errors

-

#### Detailed description

f_tic counts clock tics since program start. f_toc counts seconds since clock() readout in t till current time

### f_timeDiff

> external function f_timeDiff( | integer | t_stop,
> | integer | t_start | ) return integer

#### Purpose

Difference between two time

#### Parameters

t_start | in integer - start time
t_stop | in integer - stop time

#### Return Value

integer | t_stop-t_start

#### Errors

-

#### Detailed description

-

> external function f_time() return integer

Current calendar time of the system in seconds

> external function f_ctime( | integer | pl_sec | ) return charstring

Convert a time value in seconds to human readable string The time represented as local time

> external function f_ctime_UTC( | integer | pl_sec | ) return charstring

Convert a time value in seconds to human readable string The time represented as UTC

> external function f_getTimeFormatted( | integer | pl_sec,
> | charstring | pl_format | ) return charstring

Return the current calendar time in a formatted way

> external function f_time2sec( | integer | pl_year,
> | integer | pl_mon,
> | integer | pl_day,
> | integer | pl_hour,
> | integer | pl_min,
> | integer | pl_sec | ) return integer

function to convert a formated time value to seconds The time represented as local time

> external function f_time2sec_UTC( | integer | pl_year,
> | integer | pl_mon,
> | integer | pl_day,
> | integer | pl_hour,
> | integer | pl_min,
> | integer | pl_sec | ) return integer

function to convert a formated time value to seconds The time represented as UTC

> external function f_getCurrentDateWithOffset( | integer | pl_sec | ) return charstring

Generate a date from the actual date and time plus the parameter in seconds e.g.

> external function f_getCurrentGMTDate() return charstring

Return the current GMT date in format RFC 1123-Date ex :Sat, 13 Nov 2010 23:30:02 GMT

> external function f_tic() return integer

Return the number of clock ticks used by the application since the program was launched

> external function f_toc( | integer | t | ) return float

Elapsed seconds since time t (only when f_tic() returns the number of clock ticks elapsed since the program was launched)

> external function f_timeDiff( | integer | t_stop,
> | integer | t_start | ) return integer

Difference between two time