Hi,
If I understand correctly, the default datetime cast expects the string to be in YYYYMMDD, MM/DD/YYYY format. Is there a way to specify the format explicitly for parsing? I’ve some data in DD/MM/YYYY format and other formats and having trouble parsing it in Q.
The date format parameter is a boolean value that specifies the format expected in date parsing. A value of 0 corresponds to mm/dd/yyyy; a value of 1 corresponds to dd/mm/yyyy. This parameter corresponds to the command \z.
The Google “site” operator is usefulsite:code.kx.com "date format"greg~krsnadas.org–from: Sam jain.samit@gmail.comto: personal-kdbplus@googlegroups.comdate: 15 October 2012 14:19subject: Re: [personal kdb+] Re: format specific datetime parseYes, I was able to figure it out. Actually the search tool is prettycool. The google search on this wasn’t helpful.Its good to have a thread here in case someone else comes here seekinghelp on this :)–from: Charles Skelton charlie@kx.comto: personal-kdbplus@googlegroups.comdate: 15 October 2012 02:34subject: Re: [personal kdb+] Re: format specific datetime parseMaybe it is easily overlooked. Searching code.kx.com for “date format” -http://code.kx.com/wiki/JB:QforMortals2/commands_and_system_variables#Date_Format_.28-z.29Date Format (-z)The date format parameter is a boolean value that specifies the formatexpected in date parsing. A value of 0 corresponds to mm/dd/yyyy; avalue of 1 corresponds to dd/mm/yyyy. This parameter corresponds tothe command \z.–On Mon, Oct 15, 2012 at 4:58 AM, Sam <jain.samit> wrote:Thnks. I did a lot of searching, reading and experimentation beforeposting it here. Unfortunately, there is no specific topic on datetimeanywhere.-z, \z date formatdoesn’t really explain anything. Thanks :)–On Sunday, October 14, 2012 9:18:48 PM UTC-4, abcfoots wrote:code.kx.com is really worth readingq)\z 1q)“d”$“Z”$"16/09/2012 14:33:32"2012.09.16–On Sunday, October 14, 2012 8:45:37 PM UTC-4, Sam wrote:For example:q)“D”$"16/09/2012 14:33:32"0Nd–On Sunday, October 14, 2012 8:43:49 PM UTC-4, Sam wrote:Hi,If I understand correctly, the default datetime cast expects thestring to be in YYYYMMDD, MM/DD/YYYY format. Is there a way to specifythe format explicitly for parsing? I’ve some data in DD/MM/YYYY formatand other formats and having trouble parsing it in Q.thanks–from: Sam jain.samit@gmail.comto: personal-kdbplus@googlegroups.comdate: 14 October 2012 18:17subject: [personal kdb+] Re: format specific datetime parseI also want to note that I am reading the file using 0: and it is notpossible to manipulate the strings..–On Sunday, October 14, 2012 8:45:37 PM UTC-4, Sam wrote:For example:q)“D”$"16/09/2012 14:33:32"0Nd–On Sunday, October 14, 2012 8:43:49 PM UTC-4, Sam wrote:Hi,If I understand correctly, the default datetime cast expects thestring to be in YYYYMMDD, MM/DD/YYYY format. Is there a way tospecify the format explicitly for parsing? I’ve some data inDD/MM/YYYY format and other formats and having trouble parsing it inQ.thanks</jain.samit>