?
Solved

Convert date

Posted on 2011-09-09
7
Medium Priority
?
413 Views
Last Modified: 2012-05-12
Hi Experts,

I am using api of facebook to get some informations about my events, but the date of event is comming this way:

<start_time>1357093800</start_time>
<end_time>1357104600</end_time>

How convert this in a datetime with Delphi Xe
Thanks for some help
0
Comment
Question by:alpires
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 25

Expert Comment

by:epasquier
ID: 36510804
you can use this website
http://www.onlineconversion.com/unix_time.htm

ok, I know it is a joke, you mean in code :o) Well that is my first finding on your subject, the format of the data you have is "UNIX TimeStamp" . All we have to do now is finding its coding and why not a Delphi function that converts it
0
 
LVL 25

Expert Comment

by:epasquier
ID: 36510815
And here we go !

http://www.delphifaq.com/faq/f91.shtml

it's easier when you know what the format is
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 36510822
That appears to be a Unix datetime which is kept as the number of seconds since a specific date.  I forget the date.

Here is a question that I believe solves it
http://www.experts-exchange.com/Programming/Languages/Pascal/Delphi/Q_20006708.html

mlmcc
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 46

Expert Comment

by:aikimark
ID: 36510923
@alpires

according to the epasquier, the date values are:
1/2/2013 2:30:00 AM
1/2/2013 5:30:00 AM
0
 

Author Comment

by:alpires
ID: 36511271
The problem is that dates dont mach

In face book 1357093800 is January 1, 2013 14:30:00 and not Wed, 02 Jan 2013 02:30:00

Some idea ?
0
 
LVL 25

Accepted Solution

by:
epasquier earned 1000 total points
ID: 36511724
yes, you have problems with Time Zones. You must know which TZ is used by facebook (I hope UTC, but some source talks about pacific time), then convert that (shift is a better word)  to your own. That is another problem.

here are a few starters :
http://stackoverflow.com/questions/4134718/facebook-events-and-timezones-how-to-convert-utc-datetime-to-what-facebook-expec
0
 
LVL 101

Assisted Solution

by:mlmcc
mlmcc earned 1000 total points
ID: 36511725
Unix Time is generally saved as GMT so to use it you have to adjust for the time zone.  

For you, you subtract 4 hours from the time.

For me in Central US I subtract 6 hours (5 during Dylight savings)

That is 12 hours earlier so it is probably for someone in the south Pacific like on Somoa.

mlmcc
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Suggested Courses

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question