graylog2-web-interface/src/components/common/Timestamp.md
For the following examples we are using the date time 2010-07-30T16:03:25.000Z.
By default, the output will be based on the user time zone defined for the style guide.
The component displays the date time in the default format for date times in the graylog UI, when no format is specified.
<Timestamp dateTime="2010-07-30T16:03:25.000Z" />
In this example we are displaying the provided time as UTC.
<Timestamp dateTime="2010-07-30T16:03:25.000Z" tz="UTC" />
import { DATE_TIME_FORMATS } from 'util/DateTime';
<table cellPadding="10">
<thead>
<tr>
<th style={{ width: '150px' }}>Format</th>
<th>Output</th>
</tr>
</thead>
<tbody>
{Object.keys(DATE_TIME_FORMATS).map((format) => (
<tr key={format}>
<td>{format}</td>
<td>
<Timestamp dateTime="2010-07-30T16:03:25.000Z" format={format} />
</td>
</tr>
))}
</tbody>
</table>;
<Timestamp dateTime={new Date()} />