time.format
0.000001

Formats the given timestamp using directives defined by the format string.

Arguments
stringrequired
The format string.
Return Value
The formatted string representation of the given timestamp.
something went wrong :(
Formatting the current time
Setup
authorization=PROCAUTH
require "proc"

client = Proc.connect("PROCAUTH")
const Proc = require("@proc.dev/client");
const client = Proc.connect("PROCAUTH");
client.time.format.call(
  1617888664.432987, string: "%Y-%m-%d at %H:%M:%S"
)
client.time.format.call(
  1617888664.432987, {string: "%Y-%m-%d at %H:%M:%S"}
);
curl "https://proc.run/time/format?string=%Y-%m-%d%20at%20%H:%M:%S" --silent \
--header "authorization: bearer $authorization" \
--header "content-type: text/plain" \
--data "1617888664.432987"
 

2021-04-08 at 13:31:04

Format String Directives

%a Abbreviated day of the week.
%A Full day of the week.
%b Abbreviated month name.
%B Full month name.
%C Century number as a two-digit number.
%d Day of the month with leading zeros.
%e Day of the month without leading zeros.
%g Last 2 digits of the ISO 8601 week-based year.
%G ISO 8601 week-based year.
%H Hour of the day using the 24-hour clock, with leading zeros.
%I Hour of the day using the 12-hour clock, with leading zeros.
%j Day of the year.
%k Hour of the day using the 24-hour clock, without leading zeros.
%l Hour of the day using the 12-hour clock, without leading zeros.
%L Millisecond of the second.
%m Month of the year, with leading zeros.
%M Minute of the hour.
%p Meridian indicator, uppercase.
%P Meridian indicator, lowercase.
%s Seconds since the unix epoch.
%S Second of the minute.
%u Day of the week, starting with Monday as 1.
%U Week number of the year, starting with Sunday.
%V Week number of the ISO 8601 week-based year.
%w Day of the week, starting with Sunday as 0.
%W Week number of the year, starting with Monday.
%y Year as a number, without a century.
%Y Year as a number, including the century.
%z Timezone as hour and minute offset from UTC.
%Z Abbreviated timezone.

Stuck? Want to chat about an idea? Join the community on Discord.