datetime
)A date and/or time conversion tool (like
printf
but for date and time values)
While date
is a standard UNIX tool, it’s syntax can vary from Linux to macOS. datetype
aims to be a cross platform alternative while also offering a range of saner syntax options too.
The syntax for datetime
is modelled from date and time libraries from various popular programming languages.
Pass date/time value as a parameter:
datetime --in "format" --out "format" --value "date/time" -> <stdout>
Read date/time value from stdout:
<stdin> -> datetime --in "format" --out "format" -> <stdout>
» datetime --in "{now}" --out "{go}01/02/06 15:04:05"
12/08/21 22:32:30
» echo "12/08/21 22:32:30" -> datetime --in "{go}01/02/06 15:04:05" --out "{unix}"
1639002750
» datetime --value "12/08/21 22:32:30" --in "{go}01/02/06 15:04:05" --out "{unix}"
1639002750
--in
Defines the date/time string is formatted in --value
--out
Defined how the date/time string should be formatted in stdout--value
Date/time value to convert (if omitted and the input format is not set to {now}
then date/time is read from stdin)datetime
supports a number of parsers, defined in curly braces.
{py}
: Python strftime / strptime format codesMurex doesn’t support all the language and locale features of Python, instead defaulting to English. However enough support is there to cover most use cases.
Documentation regarding these format codes can be found on docs.python.org.
{go}
: Go (lang) time.Time format codesMurex has full support for Go’s date/time parsing.
Documentation regarding these format codes can be found on pkg.go.dev.
{now}
: Current date and timeThis is only supported as an input. When it is used --value
flag is not required.
datetime
str.datetime
[ ..Range ]
: Outputs a ranged subset of data from stdina
): A sophisticated yet simple way to stream an array or list (mkarray)This document was generated from builtins/core/time/datetime_doc.yaml.
This site's content is rebuilt automatically from murex's source code after each merge to the master
branch. Downloadable murex binaries are also built with the website.
Last built on Tue Dec 10 22:56:57 UTC 2024 against commit 60f05a260f05a227caf73dd5b3478e3cb3f4bb24e46745b.
Current version is 6.4.1005 (develop) which has been verified against tests cases.