How to get the date of a post in WordPress, so I could use it in a script? May 29, 2022 by Tarik Billa get_the_date and/or get_the_time will return the date/time of the post rather than printing it.