Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Convert date

Posted on 2011-09-09
7
Medium Priority
?
418 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

618 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