Converting Times
Forums
Hey everyone,
I'm relatively new to IdeaScript and want to transfer Times to other Timezones. I do have all the data I need
Example for my Table:
User Time Sub/Add Hours Minutes
xy 15:12:00 + 6 00
yz 13:20:16 - 2 30
I would like to add 6 hours in the first row and substract 2 hours and 30 minutes in the second row and create a new Field (Local Time) with the new Time.
I can't think of a solution. Please help me out :-)
Thank you again
Hi Brian,
thank you again. Sorry for not replying yesterday. I had so much stuff going on that I haven't found the time.
I tested your Script and it worked. I only edited it a bit to increase the reusability of the code. Here is what I did:
<code>
Function ChangeTimeFieldToChar(IDM As String, Fieldname As String)
On Error GoTo ErrHandler_ChangeTimeFieldToChar
Dim db As database
Dim task As task
Dim table As tabel
Dim field As field
Set db = Client.OpenDatabase(IDM)
Set task = db.TableManagement
Set table = db.TableDef
Set field = table.NewField
field.Name = Fieldname
field.Description = ""
field.Type = WI_CHAR_FIELD
field.Length = 8
task.ReplaceField Fieldname, field
task.PerformTask
Client.CloseAll
Set task = Nothing
Set db = Nothing
Set table = Nothing
Set field = Nothing
Exit Function
ErrHandler_ChangeTimeFieldToChar:
If Err.Number = 0 Then
Write #1, Now, " - ERROR - " , "ChangeTimeFieldToChar", Err.Number, Err.Description, "Error Not defined"
Else
Write #1, Now, " - ERROR - " , "ChangeTimeFieldToChar", Err.Number, Err.Description
End If
errorOccurred = TRUE
'resume next
End Function
</code>
So thanks again for helping me so much:-)
Have a nice weekend!
Hi Steve, here is some code