Search

What the Quote?

"Xpages make life worth living."

Doug Demo

"That's a crazy, wet amount of water. I'm gonna eat a bear."

Laura Tripcony

"By the power of XML, I am He-Coder!"

Adam Slagle

« Everything old is new again | Main| PercentRem.com »

Cheap date

Category domino lotusscript
I just had an epiphany... or maybe just an apostrophe. I'm in the middle of some code that does some date matching (determines which document to process based on date information posted from a web application). I don't have control over the date format posted to the agent, and currently the format is [Month abbreviation][unpadded day number][day number suffix] - i.e., Apr15th. I already knew that passing "April 15th" to the constructor of a NotesDateTime object would create an instance representing [04/15/2008 12:00:00]. But did you know that "Apr15th" will too? As it turns out, it actually ignores the suffix: "Apr15bogus", for example, creates a date with the same properties. Always good to find these things out before I resort to string parsing...

(cross-posted at BleedYellow)

Comments

Gravatar Image1 - An recent conversation on date parsing:

{ Link }

Post A Comment

:-D:-o:-p:-x:-(:-):-\:angry::cool::cry::emb::grin::huh::laugh::lips::rolleyes:;-)