What I thought would be some simple timestamp formatting is giving me a bit of grief. Probably just a silly mistake though!
In my Rails 4 app, I'm retrieving data from Stripe's API. I'm having an issue with the timestamps that they return.
If I just output the timestamp like this:
@subscription.trial_end
then I have no problem. But if I want to format the timestamp like this:
@subscription.trial_end.strftime("%d/%m/%Y")
then I'm getting this error:
undefined method `strftime' for 1384109487:Fixnum
Can I use strftime
on this value?
Sorry - got it sorted:
Time.at(@subscription.trial_end).strftime("%d/%m/%Y")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With