Thanks for the suggestions every1 :-)
________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jangita Sent: Wednesday, 8 February 2006 20 17 To: [email protected] Subject: RE: [delphi-en] TimeToStr I think that's taken care of with the function FormatDateTime('hhnn', dtPicker.Time) The hhnn specifier is defined as follows hh Displays the hour with a leading zero (00-23). nn Displays the minute with a leading zero (00-59). So it will always be 0102 or 1235 what I DON'T know is if its in 12 or 24 hour format -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Vahan Yoghoudjian Sent: Wednesday 08 February 2006 12:11 p To: [email protected] Subject: RE: [delphi-en] TimeToStr I dont think this is a solid solution what would this code do in case time is displayed as: (02 45) or (2 45) or (14 45)? -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] Behalf Of Jangita Sent: Wednesday, February 08, 2006 10:58 AM To: [email protected] Subject: RE: [delphi-en] TimeToStr This works: ======== dtPicker.Time := EncodeTime(Copy(tmp, 1, 2), Copy(tmp, 2, 2), 0, 0); <= no biggie to use ,+ I guess it's much more reliable -- couldn't have done it better myself :) -----Original Message----- From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Brad Hall Sent: Wednesday 08 February 2006 1:41 a To: [email protected] Subject: RE: [delphi-en] TimeToStr Hi J :-) The time is selected by the user using a TDateTimePicker (Kind := Time), which is then saved to a text file in the format 'hhnn' (hoursmins). When the user wants to view the saved record from the text file at a later time, the TDateTimePicker time value has to show the time that user previously entered. So when I try to convert the time value (stored as a string) from the text file using StrToTime, I get the conversion error. ** Also, I chkd my prev e-mail + noticed I wrote TimeToStr when I meant to write StrToTime 8-| Code eg: Save to text file =========== StrList.Add('Record1|' + FormatDateTime('hhnn', dtPicker.Time)); <= I have tried diff format routines as well StrList.SaveToFile(Path); Read back val: ========== StrList.LoadFromFile(Path); tmp := GetVal(StrList[0], 2); //retrieves time val from strlist dtPicker.Time := StrToTime(tmp); <= error This works: ======== dtPicker.Time := EncodeTime(Copy(tmp, 1, 2), Copy(tmp, 2, 2), 0, 0); <= no biggie to use ,+ I guess it's much more reliable Thanks :-) ________________________________ From: [email protected] [mailto:[EMAIL PROTECTED] On Behalf Of Jangita Sent: Tuesday, 7 February 2006 20 20 To: [email protected] Subject: Re: [delphi-en] TimeToStr that really depends on what you want to end up with, do you want to have your time as a TDateTime regardless of the settings of the OS? if you rely on the OS settings you will get loads of complaints from customers :) where is this time coming from? a database? a text box? from the serial port? it could give an indication of how this can be achieved without alot of confusing programing let me know j -----Original Message----- From: "Brad Hall" <[EMAIL PROTECTED]> To: <[email protected]> Date: Tue, 7 Feb 2006 09:49:59 +1100 Subject: [delphi-en] TimeToStr > Hi everybody :-) > > Has any1 encountered a Windows OS that has the regional settings for > the > Time Separator set as ' ' (a space) instead of the usual ':' (colon) + > then tried to use the TimeToStr func in Delphi? eg: the time appears as > "10 26" instead of "10:26" in Windows. I keep getting a "Date value not > valid" error. > > > > I've tried setting the TimeSeparator, ShortTimeFormat + LongTimeFormat > values in Delphi, but that doesn't help. The only way I got around this > issue at the moment was to extract the hrs, mins + secs from the string > containing the time + then pass those vals into the EncodeTime func. > > > > Has any1 got any ideas that don't involve splitting the time string + > passing the vals to EncodeTime? > > Using D6E. > > > > Thanks :-) > > > > > > > > > > > > [Non-text portions of this message have been removed] > > > > ----------------------------------------------------- > Home page: http://groups.yahoo.com/group/delphi-en/ > To unsubscribe: [EMAIL PROTECTED] > Yahoo! Groups Links > > > > > > > ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] SPONSORED LINKS C programming language <http://groups.yahoo.com/gads?t=ms&k=C+programming+language&w1=C+program ming+language&w2=Computer+programming+languages&w3=Java+programming+lang uage&w4=The+c+programming+language&w5=C+++programming+language&w6=Concep t+of+programming+language&c=6&s=194&.sig=lC1PxfzvANy_Br-nPkXYTA> Computer programming languages <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=C +programming+language&w2=Computer+programming+languages&w3=Java+programm ing+language&w4=The+c+programming+language&w5=C+++programming+language&w 6=Concept+of+programming+language&c=6&s=194&.sig=7XFXh-0Mon1IfLuOVlwvdg> Java programming language <http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=C+prog ramming+language&w2=Computer+programming+languages&w3=Java+programming+l anguage&w4=The+c+programming+language&w5=C+++programming+language&w6=Con cept+of+programming+language&c=6&s=194&.sig=UITodqn0qTCUcae_mpRQog> The c programming language <http://groups.yahoo.com/gads?t=ms&k=The+c+programming+language&w1=C+pro gramming+language&w2=Computer+programming+languages&w3=Java+programming+ language&w4=The+c+programming+language&w5=C+++programming+language&w6=Co ncept+of+programming+language&c=6&s=194&.sig=xnZC2-BzDSLhhir3MLtssg> C programming language <http://groups.yahoo.com/gads?t=ms&k=C+++programming+language&w1=C+progr amming+language&w2=Computer+programming+languages&w3=Java+programming+la nguage&w4=The+c+programming+language&w5=C+++programming+language&w6=Conc ept+of+programming+language&c=6&s=194&.sig=RTzTl3BOJWbWK14CdUrO0w> Concept of programming language <http://groups.yahoo.com/gads?t=ms&k=Concept+of+programming+language&w1= C+programming+language&w2=Computer+programming+languages&w3=Java+program ming+language&w4=The+c+programming+language&w5=C+++programming+language& w6=Concept+of+programming+language&c=6&s=194&.sig=x4ueM0tA417JDq3ckdJ9CQ > ________________________________ YAHOO! GROUPS LINKS * Visit your group "delphi-en <http://groups.yahoo.com/group/delphi-en> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] SPONSORED LINKS C programming language <http://groups.yahoo.com/gads?t=ms&k=C+programming+language&w1=C+program ming+language&w2=Computer+programming+languages&w3=Java+programming+lang uage&w4=The+c+programming+language&w5=C+++programming+language&w6=Concep t+of+programming+language&c=6&s=194&.sig=lC1PxfzvANy_Br-nPkXYTA> Computer programming languages <http://groups.yahoo.com/gads?t=ms&k=Computer+programming+languages&w1=C +programming+language&w2=Computer+programming+languages&w3=Java+programm ing+language&w4=The+c+programming+language&w5=C+++programming+language&w 6=Concept+of+programming+language&c=6&s=194&.sig=7XFXh-0Mon1IfLuOVlwvdg> Java programming language <http://groups.yahoo.com/gads?t=ms&k=Java+programming+language&w1=C+prog ramming+language&w2=Computer+programming+languages&w3=Java+programming+l anguage&w4=The+c+programming+language&w5=C+++programming+language&w6=Con cept+of+programming+language&c=6&s=194&.sig=UITodqn0qTCUcae_mpRQog> The c programming language <http://groups.yahoo.com/gads?t=ms&k=The+c+programming+language&w1=C+pro gramming+language&w2=Computer+programming+languages&w3=Java+programming+ language&w4=The+c+programming+language&w5=C+++programming+language&w6=Co ncept+of+programming+language&c=6&s=194&.sig=xnZC2-BzDSLhhir3MLtssg> C programming language <http://groups.yahoo.com/gads?t=ms&k=C+++programming+language&w1=C+progr amming+language&w2=Computer+programming+languages&w3=Java+programming+la nguage&w4=The+c+programming+language&w5=C+++programming+language&w6=Conc ept+of+programming+language&c=6&s=194&.sig=RTzTl3BOJWbWK14CdUrO0w> Concept of programming language <http://groups.yahoo.com/gads?t=ms&k=Concept+of+programming+language&w1= C+programming+language&w2=Computer+programming+languages&w3=Java+program ming+language&w4=The+c+programming+language&w5=C+++programming+language& w6=Concept+of+programming+language&c=6&s=194&.sig=x4ueM0tA417JDq3ckdJ9CQ > ________________________________ YAHOO! GROUPS LINKS * Visit your group "delphi-en <http://groups.yahoo.com/group/delphi-en> " on the web. * To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]> * Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service <http://docs.yahoo.com/info/terms/> . ________________________________ [Non-text portions of this message have been removed] ----------------------------------------------------- Home page: http://groups.yahoo.com/group/delphi-en/ To unsubscribe: [EMAIL PROTECTED] Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/delphi-en/ <*> To unsubscribe from this group, send an email to: [EMAIL PROTECTED] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/

