Getting a date-time field and returning just the time in a different format
I'm currently trying to write a script where it grabs a date-time field, reads only the time, and changes the time to a new time from a time field. So far this is what I have:
- eventTime = rec.Start.getTime();
- eventTime = eventTime.toString("yyy-MM-dd","HH:mm:ss");
-
info eventTime;
-
newHour = input.New_Time.getHour();
-
newMinutes = input.New_Time.getMinutes();
-
newSeconds = input.New_Time.getSeconds();
- newTime = newHour + ": " + newMinutes + ":" + newSeconds;
- newTime = newTime.toString();
- info newTime;
It's currently returning the time but I'm trying to figure out how to change the time. I first tried the toTime() and toString(), but it's not changing the format of it.