Author |
Message |
fblau Principal Member


Joined: 07 Feb 2005
              Posts: 220

|
Posted: Fri Mar 11, 2005 2:22 pm Post subject: DateTime Conversion |
|
|
I get a date value from a DOS batch file DIR command that looks like this:
"02/22/2005 03:49 PM"
When DI imports this to a datetime column, it makes it
02/22/2005 03:49 AM
Any ideas? |
|
Back to top |
|
 |
Nicolas Hadj-Blaha Principal Member


Joined: 10 Mar 2005
               Posts: 481 Location: New Zealand

|
Posted: Mon Mar 14, 2005 6:17 am Post subject: Re: DateTime Conversion |
|
|
May be you could try to use the to_date() function to convert the output of the DOS command before assigning it to a global variable.
A possible workaround would be to remove the PM/AM from the output string and reassign it automatically with the to_date() function.
Hope this helps.
Nicolas
www.dataintegrator.net _________________ Lead Data Architect, Synchrony Global |
|
Back to top |
|
 |
BODIpop Senior Member


Joined: 14 Feb 2005
              Posts: 38

|
Posted: Mon Mar 14, 2005 10:00 am Post subject: Re: DateTime Conversion |
|
|
you could take the string in as a varchar. Within a query use a substring to get the time part out do and if then else on the PM/AM characters to decide whether to add 12hrs or not this should give you a 24hr clock.Glue it all back together as a string.and then to_date it. |
|
Back to top |
|
 |
dnewton Forum Addict


Joined: 30 Jan 2004
                Posts: 3458 Location: Massachusetts, USA

|
Posted: Mon Mar 14, 2005 10:31 am Post subject: Re: DateTime Conversion |
|
|
It may be the space in between the "3:49" and "PM" that is causing the problem. That is, if it were "3:49PM" (no space) maybe it would convert more cleanly? |
|
Back to top |
|
 |
|