0

I am trying to display date string from JSON that looks like:

/Date(1115190000000-0700)/

By performing a php echo statement:

<?php
  $date = $contract['ContractResult'][0]['ContractDate']; //which is /Date(1115190000000-0700)/
  echo $date;
?>

My JSON is coming from WCF if that matters.

2
  • What is the problem? echo seems to work just fine. What does your script do, and what do you want it to do? Commented Dec 9, 2011 at 1:01
  • Is there a question in there? Commented Dec 9, 2011 at 1:02

1 Answer 1

1

You'll have to parse it. This requires you to find out what 1115190000000 and what 0700 means. The latter part might be some UTC offset (I'm just guessing)?

Once you have a timestamp, you can:

echo date('d.m.Y', $timestamp);

BTW: I found out that 1115190000 is 04.05.2005. Does this make sense to you?

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you, that is the correct date in our database. I will try to parse my $date to your $timestamp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.