Go Back   MarcomCentral (PTI) and FusionPro User Communities > Software-Related Talk > The JavaScript Library

Notices

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 4th, 2019, 03:42 PM
rrdwitt rrdwitt is offline
Regular Contributor
 
Join Date: May 2016
Location: Missouri
Posts: 53
Default Date error

Hello all, I have tried the Format date function and several others but
I cannot get the date formatted correctly. Seems a fairly simple rule but his one is not working. The number coming in is "01252020" I would like it to read January, 25 2020. But I keep getting the attached error.

Thanks
Attached Images
File Type: jpg date error.jpg (33.3 KB, 10 views)
Reply With Quote
  #2  
Old April 5th, 2019, 07:01 AM
sschardan sschardan is offline
Regular Contributor
 
Join Date: Oct 2008
Location: St. Louis, MO
Posts: 87
Default Re: Date error

I'm sure there is a more concise way to do this, but this works:

var month = Left(Field("date"), 2)
var day = Left((Right(Field("date"), 6)), 2)
var year = Right(Field("date"), 4)

return FormatDate((month + " " + day + " " + year), "lm d, yyyy");
Reply With Quote
  #3  
Old April 5th, 2019, 07:23 AM
rrdwitt rrdwitt is offline
Regular Contributor
 
Join Date: May 2016
Location: Missouri
Posts: 53
Default Re: Date error

Thank you, I will give it a try. Privacy in mind, are you someone I used to work with? Your user name sounds familiar
Reply With Quote
  #4  
Old April 5th, 2019, 07:30 AM
sschardan sschardan is offline
Regular Contributor
 
Join Date: Oct 2008
Location: St. Louis, MO
Posts: 87
Default Re: Date error

You are welcome. And privacy in mind, yes.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 08:32 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
(c) 2011, PTI Marketing Technologies™, Inc.