473,809 Members | 2,712 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

converting from decimal to datetime format

8 New Member
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 2661
JosAH
11,448 Recognized Expert MVP
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 New Member
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 New Member
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 Recognized Expert MVP
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
118841
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, which holds as true on reversal back to datetime. AM Example:
4
11212
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
17370
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 System.Globalization.CultureInfo("en-GB", true); DateTime dateUK = DateTime.ParseExact(DOBTxtBx.Text, "dd/MM/yyyy",
6
4131
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 DateTime Format some times it may in normal string not a DateTime. If it is in any one of the DateTime format then i have to change it as a Specfic format as "21-03-2005 11:34" using C#.Net. If its not in DateTime format then i should give a message.
9
12948
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 convert textbox data into Datatime formate it converted into MM/dd/yyyy formate, but i have a requirement in dd/MM/yyyy formate. please help me, i am using c#.
12
2705
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 and a custom int.ToString, but we can't find any clue on doing for decimal and double, which would be about half the load if they are put together (decimal and double). By changing our DateTime and Int ToStrings, we achieved a 84% performance gain,...
2
11189
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") pArray is a variant array containing a date string at pArray(4, iRecord) in the format "yyyy/mm/dd"
18
13050
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 1901. For Example: the number 3566839 is 27.11.07 7:00. To calculate this in Excel I use this: ="01.01.1901"+(A1/24-(REST(A1;24)/24))+ZEIT(REST(A1;24);0;0) (put 3566839 in field A1 and switch the format of the result-field to the corresponding...
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9601
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9198
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7653
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5550
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3861
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.