mokamilk Posted September 29, 2011 Share Posted September 29, 2011 I have a field formatted as text with the year coming first, like so: 20110914 I need it to look like this: 09/14/11 Then I also need to calculate a date 60 days from that field to use as an expiration date. Any help would be greatly appreciated. Thanks! I'm using Mac OSX 10.5.8, Acrobat 9.3.1, and FusionPro 7.1. Link to comment Share on other sites More sharing options...
Dan Korn Posted September 29, 2011 Share Posted September 29, 2011 I have a field formatted as text with the year coming first, like so: 20110914 I need it to look like this: 09/14/11 var s = Field("MyDateField"); var myDate = new Date(s.substr(0,4), parseInt(s.substr(4,2), 10)-1, s.substr(6,2)); return FormatDate(myDate, "mm/dd/yy"); Then I also need to calculate a date 60 days from that field to use as an expiration date. var s = Field("MyDateField"); var myDate = new Date(s.substr(0,4), parseInt(s.substr(4,2), 10)-1, s.substr(6,2)); myDate.setDate(myDate.getDate() + 60); return FormatDate(myDate, "mm/dd/yy"); Link to comment Share on other sites More sharing options...
mokamilk Posted September 29, 2011 Author Share Posted September 29, 2011 This worked perfectly. Thanks much! Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.