ID |
Date |
Icon |
Author |
Author Email |
Category |
OS |
ELOG Version |
Subject |
69310
|
Wed Feb 24 08:44:42 2021 |
| Martin Neumann | elog.20.beazy@spamgourmet.com | Question | Linux | V3.1.4-80633ba | Re: Date conversion |
I don't feel comfortable allowing the elog daemon to execute random shell scripts. Is there no other way?
Andreas Luedeke wrote: |
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:
|
|
69312
|
Tue Mar 2 15:17:56 2021 |
| Sebastian Schenk | sebastian.schenk@physik.uni-halle.de | Question | Linux | V3.1.4-80633ba | Re: Date conversion |
One other way would be to do the conversion on the client-side using javascript.
Overwrite the complete datetime input cell and add an event listener to either onChange of this input or the submit event, to trigger the conversion before submitting, so elog would get the converted time.
In out elog some entries get additional information added in this way.
Martin Neumann wrote: |
I don't feel comfortable allowing the elog daemon to execute random shell scripts. Is there no other way?
Andreas Luedeke wrote: |
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:
|
|
|
69316
|
Wed Mar 10 17:30:23 2021 |
| Stefan Ritt | do stefan.ritt@psi.ch | Question | Linux | V3.1.4-80633ba | Re: Date conversion |
Do you actually need to convert the date into the internal format? Why not keeping simply the full string YYYY-MM-DD HH:MM. If the use is disciplined enough to always use the correct format, there should be no issue. I invented the datetime format to "force" all date/time inputs to have the correct format. If you have a proper YYYY-MM-DD HH:MM format, even sorting (now by string) should work correctly.
Martin Neumann wrote: |
Hi,
I am trying to figure out how ELOG works and I have a problem.
I have one datetime attribute, where I want the user to be able to enter the time in ISO8601 format (YYYY-MM-DD HH:MM) instead of the buttons.
How do I manage that this input is converted correctly into the internal format?
I tried adding a hidden locked Attribute called IntDate and use "Subst IntDate = $start" but the result is dates in 1970, even though I have set the Time Format to "%F %H:%M"
|
|
2001
|
Tue Oct 17 13:03:22 2006 |
| Ibrahim Genc | ig004@hotmail.com | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
deletoille wrote: | hello,
Time format = %d/%m/%Y, %T
Thanks in advance |
I think "date format" and "time format" are different tags.
you may try to use date format here. |
2002
|
Tue Oct 17 13:12:52 2006 |
| Stefan Ritt | stefan.ritt@psi.ch | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
That fix for Steve Jones was slightly different, it had to do with substitutions in threaded display. I fixed yours now in revision 1734, so give it a try.
Salut,
Stefan |
2008
|
Thu Oct 19 12:26:16 2006 |
| deletoille | xavier.deletoille@synchrotron-soleil.fr | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
Stefan Ritt wrote: | That fix for Steve Jones was slightly different, it had to do with substitutions in threaded display. I fixed yours now in revision 1734, so give it a try.
Salut,
Stefan |
Hello,
I’ve tried on the last available release (revision 1732) and I have the same problem.
You said in you previous message that: “I fixed yours now in revision 1734, so give it a try.”
Could you tell me when this one will be available?
Thanks in advance |
2009
|
Thu Oct 19 12:32:11 2006 |
| Stefan Ritt | stefan.ritt@psi.ch | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
deletoille wrote: | I’ve tried on the last available release (revision 1732) and I have the same problem.
You said in you previous message that: “I fixed yours now in revision 1734, so give it a try.”
Could you tell me when this one will be available? |
Since you checked "Linux" in the "OS" of this entry, I was under the assumption that you were able to compile elog from the Subversion repository (http://savannah.psi.ch/websvn/filedetails.php?repname=elog&path=%2Ftrunk%2Fsrc%2Felogd.c).
If you need the Windows executable, I made http://midas/elog/download/windows/elog262-6.exe for you. |
2010
|
Thu Oct 19 12:42:42 2006 |
| deletoille | xavier.deletoille@synchrotron-soleil.fr | Bug report | Linux | Windows | 2.6.2-1723 | Re: Date format in Threaded display |
IT WORKS!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
THANKS A LOT |