-2

Is there a way to get the current Unix timestamp using PHP? Is this possible?

  • 1
    What do you mean by java timestamp? Are you talking about ISO-8601 timestamps? You can always just convert it to a serializable timestamp and then in Java convert it from the serializable timestamp to a Java object if that's what you mean? – Benjamin Liu Feb 08 '18 at 00:26
  • I'm talking about getting the current java timestamp using PHP? something like 1479250540110? – nurhodelta_17 Feb 08 '18 at 00:30
  • 1
    Possible duplicate of [Convert one date format into another in PHP](https://stackoverflow.com/questions/2167916/convert-one-date-format-into-another-in-php) –  Feb 08 '18 at 00:37
  • you just have micro seconds there, you could drop the last 3 digits –  Feb 08 '18 at 00:39
  • 1384174174 translates to 11/11/2013. This isn't a PHP timestamp, it is a Unix Epoch timestamp (number of seconds since 1/1/1970). See [this post](https://stackoverflow.com/questions/535004/unix-epoch-time-to-java-date-object) to see how to convert that. – stdunbar Feb 08 '18 at 00:42
  • @stdunbar the example you provide is using Java. Can I achieve something like this using PHP? – nurhodelta_17 Feb 08 '18 at 00:52
  • @nurhodelta_17 - quick search yielded [this site](https://www.epochconverter.com/programming/php) – stdunbar Feb 08 '18 at 00:58

1 Answers1

-1

Got the answer to my question via http://currentmillis.com/. Thanks for those who commented.