Publish Date
-
jorjie_s
- Posts: 11
- Joined: August 15th, 2021, 11:49 pm
Publish Date
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
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
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
Thanks for the reply, gonna try this one.