If you define a field as "datetime" then you'll get the standard ELOG input field for datetime. It will be stored as seconds of the epoch (seconds since 1.1.1970).
You can define a field as a default string input, then it is stored as a string. But you can convert that string by a shell scripts into seconds of the epoch. See "subst" command in the documentation of the elog syntax:
Subst <attribute> = <string>
When submitting logbook entries, attribute values can be substituted by some text. This text can contain arbitrary fixed text and following values:
- $<attribute>: The entered value of the attribute itself
- $host: The host name where
elogd
is running
- $remote_host: The host name of the host from with the entry was submitted
- $short_name: The login name (if password file is present)
- $long_name: The full name from the password file for the current user
- $user_email: The email address from the password file for the current user
- $logbook: The name of the current logbook
- $date: The current date, formatted via "Date format"
- $utcdate: The current UTC date (GMT) and time, formatted via "Date format"
- $version: The version of the ELOG server in the form x.y.z
- $revision: The Subversion reversion of the ELOG server as an integer number
- $shell(<command>): <command> gets passed to the operating system shell and the result is taken for substitution.
Following example use this feature to add the remote host name to the author:
Subst Author = $author from $remote_host
Following example substitutes an attribute with the contents of a file:
Subst Info = $shell(cat /tmp/filename) (Unix)
Subst Info = $shell(type c:\tmp\filename) (Windows)
A special option are automatically generated tags, which are automatically incremented for each new message. This is achieved by putting #'s into the substitution string, which is used as a placeholder for the incrementing index. Each "#" stands for one digit, thus the statement
Subst Number = XYZ-#####
results in automatically created attributes
"Number" of the form
XYZ-00001
XYZ-00002
XYZ-00003
and so on. In addition to the #'s one may specify format specifiers which are passed to the
strftime function. This allows to create tags wich contain the current year, month and so on. Once the date part of the attribute changes, the index restarts from one. The statement
Subst Number = XYZ-%Y-%b-###
results in automatically created attributes
"Number" of the form
XYZ-2005-Oct-001
XYZ-2005-Oct-002
XYZ-2005-Oct-003
and
XYZ-2005-Nov-001
XYZ-2005-Nov-002
on the next month.