Skip to main content Skip to footer

Time Stamp Documentation

Version: 3.2.1

Retrieved: 2025-10-09 15:16:25


Time Stamp

The module will convert an existing or add a new DateTime/UnixTimestamp to a specified property determined by the Target Property setting.

Settings

Name Requirements Purpose Default
Source Property String with length 0-64 The property that contains the value to convert. If empty the Target Property will use current UTC time in the selected Output Format  
Target Property String with length 1-64 The name of the property that will contain the result.  
Output Format Select from list The format to use on the Target Property ISO8601
Custom Format String with length 0-32 Specifies the format to use when Custom is selected as Output Format. See docs for examples  
Offset Time Unit Select from list Time Unit to use for modifying timestamp  
Offset Value Integer Offset to add to the timestamps, in the selected unit (use minus for negative offset)  

Input

Any input is accepted. If a source property is configured the input must contain a valid timestamp on this property.

Output

The output will be the incoming message plus the new or converted timestamp, if the target property already exists the module will write over the old value.

The format of the output timestamp can be set to one of the following:

Format Output
ISO8601 String formatted as yyyy-MM-ddThh:mm:ss.fffZ
Unix timestamp milliseconds Integer representing the number of milliseconds since January 1st 1970
Unix timestamp seconds Integer representing the number of seconds since January 1st 1970
Custom String formatted according to the 'Custom Format' setting
Date Time DateTime type

Examples

A few examples to show how the Time Stamp module works.

Add the Current Time as a Unix Timestamp

# Settings:
Source Property = ''
Target Property = 'data.timestamp'
Output Format = 'UnixTimestamp Milliseconds'
DateTime Pattern = ''

# IN 1:
{
    'data':{
        'temp':465.3
    }
}

# OUT:
{
    'data':{
        'temp':465.3,
        'timestamp': '1572520394000'
    }
}

Convert a DateTime String to a Unix Timestamp

# Settings:
Source Property = 'data.timestamp'
Target Property = 'data.timestamp'
Output Format = 'UnixTimestamp Milliseconds'
DateTime Pattern = ''

# IN 1:
{
    'data':{
        'temp':465.3,
        'timestamp': '2019-10-31 12:13:14'
    }
}

# OUT:
{
    'data':{
        'temp':465.3,
        'timestamp': '1572520394000'
    }
}

Add Current Time as a Timestamp With Custom Format

Read more about conversion patterns on standard-date-and-time-format-strings and custom-date-and-time-format-strings.

# Settings:
Source Property = ''
Target Property = 'data.timestamp'
Output Format = 'Custom'
DateTime Pattern = 'yyyy-MM-dd HH:mm:ss'

# IN 1:
{
    'data':{
        'temp':465.3,
    }
}

# OUT:
{
    'data':{
        'temp':465.3,
        'timestamp': '2019-10-31 12:13:14'
    }
}

Convert a Unix timestamp to DateTime

# Settings:
Source Property = 'data.timestamp'
Target Property = 'data.timestamp'
Output Format = 'Date Time'

# IN 1:
{
    'data':{
        'temp':465.3,
        'timestamp': '1572523994073'
    }
}

# OUT:
{
    'data':{
        'temp':465.3,
        'timestamp': '2019-10-31T11:13:14.073Z'
    }
}

Add an Offset to a Timestamp

# Settings:
Source Property = 'data.timestamp'
Target Property = 'data.timestamp'
Output Format = 'DateTime'
DateTime Pattern = 'yyyy-MM-dd HH:mm:ss'
Offset Time Unit = "Years"
Offset Value = -1

# IN 1:
{
    'data':{
        'temp':465.3,
        'timestamp': '2019-10-31 12:13:14'
    }
}

# OUT:
{
    'data':{
        'temp':465.3,
        'timestamp': '2018-10-31 12:13:14'
    }
}