Publish Date

Discussions about CSEntry
Post Reply
jorjie_s
Posts: 11
Joined: August 15th, 2021, 11:49 pm

Publish Date

Post by jorjie_s »

Hello, just asking if there's a way that I could display publishdate "~~publishdate()~~" into a readable like Sept 23, 2024, thanks for the reply.
justinlakier
Posts: 238
Joined: November 21st, 2022, 4:41 pm

Re: Publish Date

Post by justinlakier »

Hello,

Conversion would not be automatic, you would need to create your own code to handle this. PublishDate returns a long numeric which would need to be converted into a string and split into the year/month/day substrings, so you may prefer to use SysDate with different formats to get the year/month/day.

To convert the month from a number to a readable name, first make a list of the month names in order ["Jan", "Feb", etc], then plug in the month number as the index to get back the name you need. Once you have this and the year/day numbers, you can plug these all into a maketext to make one readable string with commas and spacing.

Hope this helps,
Justin
jorjie_s
Posts: 11
Joined: August 15th, 2021, 11:49 pm

Re: Publish Date

Post by jorjie_s »

Thanks for the reply, gonna try this one.
Post Reply