PX_TIMESTAMP2STRING(3)

πŸ’– PX_TIMESTAMP2STRING(3) πŸ’–

okay bestie, welcome to the PX_timestamp2string page from the Library Functions Manual 🌸 this one is lowkey iconic, it's all about turning a paradox timestamp into a cute lil formatted string ✨


πŸŽ€ NAME πŸŽ€

PX_timestamp2string β€” converts a paradox timestamp into a formatted string πŸ’…


✨ SYNOPSIS ✨

#include <paradox.h>

char * PX_timestamp2string(pxdoc_t *pxdoc, double timestamp, const char *format)

πŸ¦‹ DESCRIPTION πŸ¦‹

so basically, this function makes a string representation of a paradox timestamp, and it does it exactly how you tell it to in the format parameter 🫢

now, the timestamp you pass in has to come from one of two places, no exceptions:

either way, a timestamp is giving both time and date energy β€” it's not one or the other, it's the whole package πŸ’–

the format string is where the magic happens. it's full of chars, and each char stands for a specific value of the date/time. here's the whole list, no skips, no gatekeeping:

πŸ”₯ Characters and their meaning in date/time format string πŸ”₯

  • Y β€” year, numeric, 4 digits
  • y β€” year, numeric, 2 digits
  • m β€” month, numeric
  • n β€” month, numeric, no leading zeroes
  • d β€” day of the month, numeric
  • j β€” day of the month, numeric, no leading zeros
  • H β€” hour, numeric, 24 hour format
  • h β€” hour, numeric, 12 hour format
  • G β€” hour, numeric, 24 hour format, no leading zeroes
  • g β€” hour, numeric, 12 hour format, no leading zeroes
  • i β€” minutes, numeric
  • s β€” seconds, numeric
  • A β€” AM/PM
  • a β€” am/pm
  • L β€” boolean for leap year

and the rest? every other character just gets copied unmodified straight to the output string, no notes, no changes πŸ’…

⚠️ but bestie listen β€” if you've got a special character that you do NOT want interpreted, you have to precede it with a backslash. otherwise it's getting read as a format char, periodt. 😭

🌈 RETURN VALUE 🌈

  • returns a pointer to string on success πŸŽ‰
  • returns NULL on failure πŸ’€

πŸ‘‘ SEE ALSO πŸ‘‘


🌸 AUTHOR 🌸

this manual page was written by Uwe Steinmann <uwe@steinmann.cx> πŸ’œ


and that's the whole page, bestie!! this one lives in the Library Functions Manual alongside PX_TIMESTAMP2STRING(3) β€” no date stamp on this baddie, it's timeless fr fr ✨ go format some timestamps, you're gonna ate πŸ«ΆπŸ’–