t := time.Now()
formatted := fmt.Sprintf("%d-%02d-%02dT%02d:%02d:%02d",
t.Year(), t.Month(), t.Day(),
t.Hour(), t.Minute(), t.Second())
date +%Y-%m-%d_%H-%M-%S
datetime.date.today().strftime("%Y-%m-%d")
datetime.datetime.now().strftime("%Y-%m-%d %H:%M")
TIL :
What is this date format? 2011-08-12T20:17:46.384
The T is just a literal to separate the date from the time, and the Z means "zero hour offset" also known as "Zulu time" (UTC). If your strings always have a "Z" you can use
$ date "+%F %T"
2016-05-24 16:02:07
The "sixth" field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh or by the shell specified in the SHELL variable of the cronfile. Percent-signs (%) in the command, unless escaped with backslash (), will be changed into newline charac- ters, and all data after the first % will be sent to the command as standard input.
un article pour se décider dans quel timezone configurer ses serveurs linux et quelques astuces si on choisit le format UTC
Apprenez à utiliser les fonctions de gestion des dates en PHP.