Article Preview
Buy Now
FEATURE
Easy Dating
Creating a simple calendar widget
Issue: 5.5 (July/August 2007)
Author: Marc Zeedar
Author Bio: Marc taught himself programming in high school when he bought his first computer but had no money for software. He's had fun learning ever since.
Article Description: No description available.
Article Length (in bytes): 26,174
Starting Page Number: 30
Article Number: 5510
Resource File(s):
5510.zip Updated: 2007-07-16 12:19:57
Related Link(s): None
Excerpt of article text...
Dates seem like such simple things to us humans, but they are surprisingly complex, especially when you look at the various ways dates are implemented internationally. For instance, in the U.S., we generally write the date as "MM/DD/YY" while in Europe the day is listed first ("DD/MM/YY"). Unfortunately, if all you are given are these numbers, it's utterly impossible to know which date "3/4/2007" means. Is it the fourth day of March or the third day of April? Unless you know the intention of whoever created the date string, it's impossible to know.
A mistake many REALbasic users make -- even experienced ones -- is assuming that REALbasic's
parseDate
function can solve the above problem. It cannot. That would be aguessDate
function, which REALbasic does not have.The purpose of
parseDate
is not to decipher the date format but to convert a date string into a date object.ParseDate
expects the date string to be in the format set in the operating system. If it's not, the string cannot be converted to a date reliably.
...End of Excerpt. Please purchase the magazine to read the full article.