I'm using date_obj.toLocaleString()
and it's outputting Sun Oct 17 09:57:59 2021
. I'd like to have it in the format Oct 17 2021 09:57pm
so that's MMM DD YYYY HH:MM AM/PM
. It should also be in local time to the current device. This is running on Android emulator. How can I do this?
I tried this at it was an answer given
created.toLocaleString("en-US", {
year: "numeric",
month: "long",
day: "numeric",
hour: "numeric",
minute: "numeric",
hour12: true,
})
But it still hasn't changed the date. I'm also running this on React Native.
I also tried
options = {
dateStyle:"medium",
timeStyle:"short"
};
still same issue unfortunately
here's the current state of the code
<Text style={{ fontSize: 13, color: "grey" }}>
{created.toLocaleString("en-US", {
year: "numeric",
day: "2-digit",
month: "short",
hour: "2-digit",
minute: "2-digit",
hour12: true,
})}
</Text>
Still no change