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

converting from decimal to datetime format

8
Hi

please If you know how to convert from Decimal format of DateTime to a real Datetime Format reply please because i'm reading a decimal value of time from a file like this one (2448220711) and I Don't know how to get the real dateTime
from This Format .

I will be Thankful if You Reply

Aisha
Jul 9 '08 #1
4 2634
JosAH
11,448 Expert 8TB
If that number is an actual time stamp you can cast it to a time_t and use the
asctime or ctime etc. functions.

kind regards,

Josd
Jul 9 '08 #2
aext
8
If that number is an actual time stamp you can cast it to a time_t and use the
asctime or ctime etc. functions.

kind regards,

Josd
Thank you for your reply
i will try it
Jul 9 '08 #3
aext
8
Hi

how to convert from decimal value to dateTime Value.
I mean that Decimal value not packed time value like(20080709) its realy decimal value like (29940722) I Read it From File but I don't know How To Convert it To a real time .

please help me .

Aisha
Jul 9 '08 #4
JosAH
11,448 Expert 8TB
Hi

how to convert from decimal value to dateTime Value.
I mean that Decimal value not packed time value like(20080709) its realy decimal value like (29940722) I Read it From File but I don't know How To Convert it To a real time .

please help me .

Aisha
Read that decimal value in a long variable and do this:

Expand|Select|Wrap|Line Numbers
  1. long decimalValue;
  2. time_t time= *((time_t*)&decimalValue);
  3. ...
  4. /* use the 'time' value for your calculation */
  5. ...
  6.  
kind regards,

Jos
Jul 9 '08 #5

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

Similar topics

3
by: Nikola | last post by:
Hi all, I have a problem converting datetime to integer (and than back to datetime). Depending whether the time is AM or PM, same date is converted to two different integer representations,...
4
by: M. Uppal | last post by:
How do i convert fraction to time in c#. I need to convert 0.25 to time. Excel does this by using Selection.NumberFormat = "h:mm:ss;@" of the Cell Format function. thanks, M. Uppal
3
by: Assimalyst | last post by:
Hi, I am trying to convert a UK formated date in a textbox to sql server format. dd/MM/yyyy -> yyyyMMdd. Here's the code: IFormatProvider format = new...
6
by: B.N.Prabhu | last post by:
Hi, I am having a DataTable which one column is in string format now i want to change that one to DataTime. I don't know whether its in datetime format or not i have to check if it is in...
9
by: Alok yadav | last post by:
i am using a webservice in which a method is serach. i use this method which accept a argument of date type in dd/MM/yyyy formate. i have a textbox which accept the date from the user, when i...
12
by: ThunderMusic | last post by:
Hi, We have a part of our application that deals with millions of records and do some processing of them. We've achieved a pretty good performance gain by developping a custom DateTime.ToString...
2
by: Brian Parker | last post by:
I am beginning to work with VB2005.NET and I'm getting some problems with string formatting converting an application from VB6. VB6 code:- sTradeDate = Format(pArray(4,i Record), "mmddyy") ...
18
by: Dirk Hagemann | last post by:
Hello, From a zone-file of a Microsoft Active Directory integrated DNS server I get the date/time of the dynamic update entries in a format, which is as far as I know the hours since january 1st...
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: 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:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.