Re: Querry

From: Fons Rademakers <Fons.Rademakers_at_cern.ch>
Date: Thu, 31 Aug 2006 01:12:28 +0200


Hi Kevin

  you can do something like this:

TDatime d;
TString x = Form("%d%d",d.GetDate(),d.GetTime())

anyway, I see that strftime is useful.

Kevin Lynch wrote:
> With respect, it doesn't look to me like TDatime has the functionality
> the original poster is looking for, at least as of 5.12. It sounds more
> like he needs the equivalent of the ANSI C functions strftime/strptime.
>
> I'm surprised that TDatime doesn't already wrap that functionality,
> since it seems to be a minimally disguised wrapper around the standard
> time_t type. It wouldn't be too hard for someone (such as the original
> poster, now that he has a pointer to strftime :-) to add that
> functionality to TDatime with a few hours of work and testing.
>
>
> Rene Brun wrote:

>> See class TDatime:
>> http://root.cern.ch/root/htmldoc/TDatime.html
>>
>> eg:
>> TDatime t;
>> t.AsString()
>>
>> Rene Brun
>>
>> Satya J wrote:
>>
>>> Hi,
>>>
>>> kindly suggest me how I can convert current date and time into a 
>>> string variable in root. I need this string in different format like
>>>
>>> current time; 11:51pm  30th Aug'06
>>> I want           2006/08/30/23/51 or 2006:08:30:23:51
>>>    &              200608302351
>>> into a char string. Can it possible?
>>>
>>> Your suggestion are highly apreciated.
>>> Satya

>
>
-- 
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail: Fons.Rademakers_at_cern.ch              Phone: +41 22 7679248
WWW:    http://fons.rademakers.org           Fax:   +41 22 7669640
Received on Thu Aug 31 2006 - 01:12:27 MEST

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:32:00 MET