Skip to content

Commit

Permalink
Add headers analyzer tool
Browse files Browse the repository at this point in the history
  • Loading branch information
255kb committed Apr 16, 2024
1 parent 9b672bb commit 6dd0a22
Show file tree
Hide file tree
Showing 4 changed files with 822 additions and 78 deletions.
163 changes: 85 additions & 78 deletions pages/tools/date-unix-timestamp-converter-formatter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -199,84 +199,91 @@ const DateConverter: FunctionComponent = function () {
{customFormat ? formatDate(currentDate, customFormat) : ''}
</h4>
</div>
<table className='table mt-8'>
<thead>
<tr>
<th>Format</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a
href='https://en.wikipedia.org/wiki/ISO_8601'
target='_blank'
>
ISO 8601, RFC 3339
</a>
</td>
<td suppressHydrationWarning>
{formatDate(currentDate, "yyyy-MM-dd'T'HH:mm:ss.SSSxxx")}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>yyyy-MM-dd'T'HH:mm:ss.SSSxxx</small>
</code>
</span>
</td>
<td></td>
</tr>
<tr>
<td>
<a
href='https://datatracker.ietf.org/doc/rfc822/'
target='_blank'
>
RFC 822/2822
</a>
</td>
<td suppressHydrationWarning>
{formatDate(currentDate, 'EEE, dd MMM yyyy HH:mm:ss xx')}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>EEE, dd MMM yyyy HH:mm:ss xx</small>
</code>
</span>
</td>
</tr>

<tr>
<td>Unix timestamp (s)</td>
<td suppressHydrationWarning>
{Math.floor(currentDate.getTime() / 1000)}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>t</small>
</code>
</span>
</td>
</tr>
<tr>
<td>Unix timestamp (ms)</td>
<td suppressHydrationWarning>
{currentDate.getTime()}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>T</small>
</code>
</span>
</td>
</tr>
</tbody>
</table>
<div className='table-responsive'>
<table className='table mt-8'>
<thead>
<tr>
<th>Format</th>
<th>Result</th>
</tr>
</thead>
<tbody>
<tr>
<td>
<a
href='https://en.wikipedia.org/wiki/ISO_8601'
target='_blank'
>
ISO 8601, RFC 3339
</a>
</td>
<td suppressHydrationWarning>
{formatDate(
currentDate,
"yyyy-MM-dd'T'HH:mm:ss.SSSxxx"
)}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>yyyy-MM-dd'T'HH:mm:ss.SSSxxx</small>
</code>
</span>
</td>
<td></td>
</tr>
<tr>
<td>
<a
href='https://datatracker.ietf.org/doc/rfc822/'
target='_blank'
>
RFC 822/2822
</a>
</td>
<td suppressHydrationWarning>
{formatDate(
currentDate,
'EEE, dd MMM yyyy HH:mm:ss xx'
)}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>EEE, dd MMM yyyy HH:mm:ss xx</small>
</code>
</span>
</td>
</tr>
<tr>
<td>Unix timestamp (s)</td>
<td suppressHydrationWarning>
{Math.floor(currentDate.getTime() / 1000)}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>t</small>
</code>
</span>
</td>
</tr>
<tr>
<td>Unix timestamp (ms)</td>
<td suppressHydrationWarning>
{currentDate.getTime()}
<br />
<span className='fs-sm'>
date-fns format:{' '}
<code>
<small>T</small>
</code>
</span>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 6dd0a22

Please sign in to comment.