« 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:;-)

Hire Me

Elsewhere

What the Quote?

"If there were meat trees, there'd be a lot more vegetarians."

Tim Tripcony

"You can always spot Java written by C-coders because it's littered with public void (blah, blah, blah). They're proceduretarded."

Nathan Freeman

"I'm tired. And the music is absurd."

Laura Tripcony

"Let me just ask you this so I can go cause more wanton destruction."

Alex Belt

"Maybe someone's lost in the nature preserve, with the monkeys and the robots."

Laura Tripcony

Apparel

Lotus Rocks

I write the code that makes the young girls cry