PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, January 21, 2022

[FIXED] Convert Unix Timestamp to Carbon Object

 January 21, 2022     laravel, php-carbon     No comments   

Issue

I have unix timestamp in table, wants to show to user using Carbon. How can I achieve ?

e.g.

1487663764.99256
To

2017-02-24 23:23:14.654621

Solution

Did you check the carbon docs? I think this is what youre looking for:

Carbon::createFromTimestamp(-1)->toDateTimeString(); 

Checkout http://carbon.nesbot.com/docs/#api-instantiation



Answered By - surgiie
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing