473,386 Members | 1,699 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,386 software developers and data experts.

How to convert int to datetime in c#?

I have two value, start and end. It stored in database. For example,
float start = 1316742254435;
float end = 1316742302359;

So how can I convert it into datetime and then time difference?
Oct 5 '11 #1
1 5451
Depending on what those numbers are, you may use one of DateTime.FromXXX methods to convert them into the corresponding DateTime object and subtracting two DateTime objects will result in a TimeSpan object.
Oct 5 '11 #2

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

Similar topics

1
by: Loi Tan Vo | last post by:
Hi, I have a text file that contains a date column. The text file will be imported to database in SQL 2000 server. After to be imported, I want to convert the date column to date type. For...
2
by: Jelena via SQLMonster.com | last post by:
Does anybody can help me to convert datetime value let's '1936-04-13 07:00:00.000' to DATE as '04/13/1936'. I need this value in the Excell as a DATE format. Thanks in advance
3
by: David | last post by:
I need to covert DateTime Variables into a byte array but all of the conversion methods do not appear to handle the DateTime type. Is there a generic way to convert any property or object into a...
3
by: Omer kamal | last post by:
Dear all, I want to save my data into MS Access database Table which consist of some fields with short date and short time formats. I try to save data in to the said table and I am getting error...
10
by: Philip Wagenaar | last post by:
I have some code to convert a date to the unixdatetime representation (number of seconds since 1970). Only problem is that it only counts from the whole day, it ignores the times part. So convert...
2
by: ziggislaw | last post by:
hello how can I convert DateTime from "25.12.2005" to "2005-12-25 00:00:00.000" ? Now I have DateTime as string (I get it from <asp:label>). Thanks
14
by: Me | last post by:
Hi all I am getting a really bizzare error on when I convert a string into a datetime: The code is : DateTime dt1 = Convert.ToDateTime("10 Sep 2005"); Console.WriteLine(dt1.Year);
1
by: jimmybaba | last post by:
hi all i am newly graduate and started my first job.......i am geting problem to convert datetime into date only , i am trying to get values from sqlserver table with comparison of date. i am using...
3
by: huohaodian | last post by:
Hi, How can I convert a value created from DateTime.Now() to the datetime format that SQL Server recognises? Thanks in advance.
2
by: ravencrt | last post by:
Hello I have a problem and I don't know how to sort it out. Why when I convert a date value to double in access vba I receive a value and when I convert the same data value to decimal in sql I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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,...

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.