Is there a date / time format that does not have spaces?

I have a CGI script that converts a given string to a date / time using the unix date command. I am looking for a format that can easily be embedded in a URL without the need for escaping with %20 . A client that builds a date / time in a URL has no conversion to unix time (seconds from an era) and has no way to convert to an offset from zulu (ISO8601 will not work). However, you can reformat the date / time used to create the URL in many other ways.

Are there any other options for plotting the date and time in a non-interval format?

+6
date linux
source share
2 answers

I found a simple job. Just use underscores for spaces and make tr in a CGI script before converting to date. It looks something like this:

stamp="$(echo $stamp|tr _ ' '|xargs -0 date -d)"

Then use a date that looks something like this:

26_Oct_2010_11:57:56_CDT

which translates to:

date -d "26 Oct 2010 11:57:56 CDT"

+1
source share
 $ date "+%F-%T" 2010-10-25-16:23:14 
+20
source share

All Articles