473,421 Members | 1,736 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,421 software developers and data experts.

How to convert numbers like 1217508668 to date and time

5
I want to convert numbers like 1217508668 to date and time
Sep 1 '10 #1
9 8044
ck9663
2,878 Expert 2GB
Your question is too generic. In any case these are sql server function to convert value/columns into a different data type.

Happy Coding!!!

~~ CK
Sep 1 '10 #2
magdy
5
Thank you too much, your fast reply,, OK, Look, I've a sql database table contains field named open_date all records shown are like 10 digits which appeared in the htmpl pages like mm/dd hh:mm.. So i want extract a report that can display these digits to be like mm/dd hh:mm....

Thank you in advance your tries,,
Sep 1 '10 #3
ck9663
2,878 Expert 2GB
... And how would you convert the number on your title?

1217508668 = what date?


~~ CK
Sep 1 '10 #4
code green
1,726 Expert 1GB
Is this a unix timestamp by any chance?
Sep 2 '10 #5
magdy
5
No its SQL
Sep 2 '10 #6
gpl
152 100+
If it was a unix time, it evaluates to 31/07/2008 12:51pm
Is this how it appears on your html page ?
What algorithm does the page use to calculate the display value ?
Sep 2 '10 #7
magdy
5
Yes.... Marvellous... please, provide me with the sql code that i can put in the crystal report program to extract a reports....
Sep 2 '10 #8
magdy
5
But the format is mm/dd/yyyy hh:mm pm or am
Sep 2 '10 #9
code green
1,726 Expert 1GB
If it is a unix timestamp you need to add 1/1/1970 to get the date.
Then use CONVERT to format the date
Expand|Select|Wrap|Line Numbers
  1. SELECT CONVERT(VARCHAR(DATEADD(SS,{1217508668},'19700101'),109))
I think this will convert your timestamp to mm/dd/yyyy hh:mm pm format.

But this is a string format.
To get to SQL Server format CAST AS DATETIME is needed

Not sure about Crystal Reports
Sep 2 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Sugapablo | last post by:
I have a table that's of type date/time (i.e. 01/01/1900 00:00:00). What I want is to do the following: Say you have these records: person | date-time -------+---------------------------...
1
by: John Feeley | last post by:
am tring to add a number of years to a dob. im doing this by adding my date+years*365.26 I get a string of numbers. I then convert the number in the next column to actual date again. I'm getting...
5
by: Helen R Martin | last post by:
I'm struggling once more with the dates in one of my Access projects.. I'd like the date/time fields to be just date fields.. its just confusing the folks using the database, and its making it...
0
by: Randall Parker | last post by:
I realize that methods like DateTime.ToLocalTime() and DateTime.ToUniveralTime() exist. But suppose one wants to query out data from a database that has UTC times in it. Suppose one wants to have...
3
by: fong.yang | last post by:
I have a textbox on my form label date/time. I also added a date/time column to my table as well. The table already contains records before the date/time column was added. How do I setup a...
2
by: Darhl Thomason | last post by:
I'm converting my Access 2003 VBA app. I have a number of date fields in my db that I want to use the date/time picker control with, but if there is no entry in my database, I want the date/time...
7
by: brainbox | last post by:
I have 2 questions: 1.When I read the number using (\S+) its getting stored as 2.08E13. Code I used: if ($line=~/4_begindt_(\S+)/) { print "$1\n" } # $1=2.08E13; instead $1 should contain...
4
by: ahmurad | last post by:
Dear Brothers, I am struggling the following four Date-Time type values which were inputted into MYSQL database in different tables. As MYSQL Default Time Format: YYYY-MM-DD HH:MM:SS, So I used...
4
by: ghjk | last post by:
I'm developing web site with php and Postgress. I want to add a date time picker to the site. I tried several calendars and they didnt work. Could some one tell me about a working javascript date...
4
by: bscott | last post by:
I am creating a linked table into access using a .csv file. One of the columns is a date/time in the following format: "06-01-2010 06:10 AM ". When I import it as Data Type Date/Time, Access...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.