Re: date formatting for CC card expiration date check
This WebDNA talk-list message is from 1998
It keeps the original formatting.
numero = 18322
interpreted = N
texte = At 1:11 PM 6/18/98, Sandra L. Pitner wrote:>[date %m/%Y] gives 06/18/1998%m/%Y]>[date %m] gives 06/18/1998%m]Are you sure you don't have [date]%m/%y] in your template?>[format 2.0f][expmonth][/format] doesn't give 02, 03, etc.,>need to add zero in front.Try [format .2d][expmonth][/format]It's not documented, but [format .(x)d] will pad the string to (x) numberof characters wide with leading zeros.>There's probably many ways to attempt this, but the most obvious ones>don't work as I'd expect them to.>>[showif [date %m]>[expmonth]]>[hideif [date %Y]<[expyear]]>>Type logic would suit me fine, as would>>[hideif [date %m/%Y]<[format 2.0f][expmonth][/format]/[expyear]]>>but no such luck. Any suggestions? My default date setting in>preferences is the default one %m/%d/%Y.Try converting the dates into number of days since 00/00/0000 and thencomparing those two numbers:[HideIf [math]{[expmonth]/01/[expyear]}[/math]>[math]{[date]}[/math]]-Daveo--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Associated Messages, from the most recent to the oldest:
At 1:11 PM 6/18/98, Sandra L. Pitner wrote:>[date %m/%Y] gives 06/18/1998%m/%Y]>[date %m] gives 06/18/1998%m]Are you sure you don't have
[date]%m/%y] in your template?>[format 2.0f][expmonth][/format] doesn't give 02, 03, etc.,>need to add zero in front.Try [format .2d][expmonth][/format]It's not documented, but [format .(x)d] will pad the string to (x) numberof characters wide with leading zeros.>There's probably many ways to attempt this, but the most obvious ones>don't work as I'd expect them to.>>[showif [date %m]>[expmonth]]>[hideif [date %Y]<[expyear]]>>Type logic would suit me fine, as would>>[hideif [date %m/%Y]<[format 2.0f][expmonth][/format]/[expyear]]>>but no such luck. Any suggestions? My default date setting in>preferences is the default one %m/%d/%Y.Try converting the dates into number of days since 00/00/0000 and thencomparing those two numbers:[HideIf
[math]{[expmonth]/01/[expyear]}[/math]>
[math]{
[date]}[/math]]-Daveo--------------- Dave MacLeay --+o----------- Digital Frontier --+o--- dave@digitalfrontier.com --+
Dave MacLeay
DOWNLOAD WEBDNA NOW!
Top Articles:
Talk List
The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...
Related Readings:
price formula (1999)
Test (2003)
[OT] photos and misc. (2004)
(1997)
[WebDNA] Problem with Cookies in IE and Safari (2009)
Math with Time (1997)
[WebDNA] Old Problem, the exclamation point (2014)
WebCatalog/WebMerchant 2.1 (1998)
'page impression' techniques for banner ads (1999)
WebCat2b14MacPlugIn - [include] doesn't hide the search string (1997)
dynamic PDF no longer working? (2004)
RE: Upload (1998)
Shopping cart not being assigned (1999)
[WebDNA] webdna online reference (2011)
Where's Cart Created ? (1997)
Search inside Include (1998)
How to append text after the sign & (1997)
TCPConnect / Current Temperature (2004)
What is WebDNA (1997)
Items in cart (2000)