get the time of date/time field using javascript (402 Views)
Reply
Regular Advisor
ulto1
Posts: 140
Registered: ‎10-11-2012
Message 1 of 5 (402 Views)

get the time of date/time field using javascript

Hi Guys,

 

just a question.

if I have this date/time field 20/01/14 13:15:00... how can I retrieve the time from that field?

 

Thanks

Honored Contributor
Vadim Gorda
Posts: 5,861
Registered: ‎11-10-2008
Message 2 of 5 (394 Views)

Re: get the time of date/time field using javascript

Hello,

there is a script portion (on Forums) which can change the date/time from JS to SM format.

 

What is exactly your task? 

Honored Contributor
Piku
Posts: 4,128
Registered: ‎06-17-2010
Message 3 of 5 (392 Views)

Re: get the time of date/time field using javascript

try function,

getISOTime()

like, field.getISOTime()

hth,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
Regular Advisor
ulto1
Posts: 140
Registered: ‎10-11-2012
Message 4 of 5 (364 Views)

Re: get the time of date/time field using javascript

Hi Vadim, Piku,

Thank you for your replies.
What I am trying to do is the following:
We want to have a CAB Matrix. When the Total number is >20, then the change should go automatically to CAB.
We have different fields. Based on the selection a number is generated.
For a specific field, based on the Planned start, if the change is planned after 5 PM then it will take a value off-peak =1
if it's between 8 and 4 pm than it will take peak=4
Honored Contributor
Piku
Posts: 4,128
Registered: ‎06-17-2010
Message 5 of 5 (361 Views)

Re: get the time of date/time field using javascript

Did you tried above function?
Could not exact requirement.

also this can be done by RAD expression like,
update :
if (time(peak in $file) > '16:00:00' and time(peak in $file) < '20:00:00')
calculation :
peak in $file = date(peak in $file) + '16:00:00'

hth,
____________________________________
Assign Kudo, if found post useful and mark it accepted if solves the issue.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation.