hipersnap
1st March 2007, 08:19
Hi, all
When you used initial UTC() in From Field if need Date value but time like
00:00.
How are you solution for it.

Example
now in from field = 1-3-2007 12:13
but you want = 1-3-2007 00:00


*----------------------*
Thank you Super
*----------------------*

en@frrom
1st March 2007, 11:31
Do you have the source code? If you have access to the program cript this is easily achieved by using the utc-conversion functions. For example:

domain tcmcs.long year, month, day, dummy, retval

retval = utc.to.date(<your_utc_date_field>, year, month, day, dummy, dummy, dummy)
<your_utc_date_field> = date.to.utc(year, month, day, 0, 0, 0)

Regards,
Eli Nager

vahdani
1st March 2007, 13:14
Hi,

just enter following as initial value for form field:

((date() - 719163) * 86400) - 3600

en@frrom
1st March 2007, 13:50
Vahdani,

Your suggestion is very nice, and will be the best one in case this is only about filling a defult date, for there is no need anymore to touch the program script. However, when user enters a utc, and you want that the time should be set to 00:00, then you will be forced to program it..

Eli Nager

vahdani
1st March 2007, 14:01
Hi Eli,

I could be wrong but I think this (ie. setting default date ) was the problem in original post. A user entering date manually can always tab to time segment and set it to zero.

hipersnap
2nd March 2007, 06:33
Thank for all replyed.

function convert.days()
{
string date1(8)
long ret
long year
long month
long days

date1 = utc.to.input(cmdt.f, "%u001")
days = val(date1(1;2))
month = val(date1(3;2))
year = val(date1(5;4))
cmdt.f = date.to.utc(year, month, days, 0, 0, 1)
cmdt.t = date.to.utc(year, month, days, 23, 59, 59)
display("cmdt.f")
display("cmdt.t")
}
Done

en@frrom
2nd March 2007, 15:36
Ok, I see you preferred the longest possible way, but ok, it works well... :)