Board index » delphi » How get a 'MM/DD/YYYY' format string..
yeskw....@bbs.yeskw.com (cocl)
![]() Delphi Developer |
Mon, 04 Aug 2003 03:59:11 GMT
|
yeskw....@bbs.yeskw.com (cocl)
![]() Delphi Developer |
Mon, 04 Aug 2003 03:59:11 GMT
How get a 'MM/DD/YYYY' format string..
How to get a 'MM/DD/YYYY' short format string suitable
for edit1.text as below, if use qry.fieldbyname('OrderDate').value edit1.text:=qry.fieldbyname('OrderDate').value; -- |
Billy KNin
![]() Delphi Developer |
Mon, 04 Aug 2003 09:48:53 GMT
Re:How get a 'MM/DD/YYYY' format string..Is using edit1.text:=FormatDateTime('dd/mm/yyyy',Date) appropriate here? Quotecocl <yeskw....@bbs.yeskw.com> wrote in message Quote> How to get a 'MM/DD/YYYY' short format string suitable |
coc
![]() Delphi Developer |
Mon, 04 Aug 2003 11:38:47 GMT
Re:How get a 'MM/DD/YYYY' format string..?i |b bk. aoj@: ?j : Is using edit1.text:=FormatDateTime('dd/mm/yyyy',Date) appropriate here? This code is make a call to the function Getellipsis.GetValue the return value is 'YYYY/MM/DD', why? below is my code: function Tgetellipsis.GetValue(Fname:string):variant; Quote: cocl <yeskw....@bbs.yeskw.com> wrote in message : > How to get a 'MM/DD/YYYY' short format string suitable : > for edit1.text as below, if use qry.fieldbyname('OrderDate').value : > edit1.text:=qry.fieldbyname('OrderDate').value; -- |
Thad Letne
![]() Delphi Developer |
Wed, 06 Aug 2003 07:05:14 GMT
Re:How get a 'MM/DD/YYYY' format string..I've been wondering if anyone knows how to go the other direction, that is to make a function that looks something like: function UnFormatDateTime(format : string; source : string):TdateTime; I know about VarToDateTime, but it isn't really as powerful as this would be. there are of course ambiguities, such as what if source is the string 'monday', but I'm sure that that could be overcome, maybe by finding the monday closest to no, or the next monday after now, or either of those with 0 instead of now. In any case even with a couple of extra ambiguity clarifiers I think such a function would vastly simplify the handling of datetimes especially when interacting with users. Does anyone have thoughts about this? -Thad QuoteBilly KNine wrote: |
Bj?rge S?the
![]() Delphi Developer |
Fri, 08 Aug 2003 18:00:59 GMT
Re:How get a 'MM/DD/YYYY' format string.."Thad Letnes" <tlet...@wizdom.com> skrev i melding news:3A8DB22A.A6B82A0D@wizdom.com... Quote> I've been wondering if anyone knows how to go the other direction, that While this function is not the prettiest I've written, it works (in Norway, "dd" = today ...all written to handle the DDMMYY order of operators and Norwegian + Good luck ! ------ implementation function StraightenDate(S: string): string; function LeadingZeros(const Text: string; Count: integer): string; function LeadingZeros(Number, Count: integer): string; function NamesToMonths(const S: string): string; // This replaces the month name with the corresponding begin function NamesToDays(const S: string): word; function RemoveSeparators(const S: string): string; function StrToDateEx(S: string; DefaultDate: TDateTime): TDateTime; // -- |
Thad Letne
![]() Delphi Developer |
Fri, 08 Aug 2003 23:08:38 GMT
Re:How get a 'MM/DD/YYYY' format string..thanks, I'll tak a look through it, is it ok with you if I post any revisions?(with appropriat credit to you) Quote"Bj?rge S?ther" wrote: |
Bj?rge S?the
![]() Delphi Developer |
Sat, 09 Aug 2003 00:00:16 GMT
Re:How get a 'MM/DD/YYYY' format string.."Thad Letnes" <tlet...@wizdom.com> skrev i melding news:3A9136F6.8CBE2B93@wizdom.com... Quote> thanks, I'll tak a look through it, is it ok with you if I post any -- |
1. Change format dd/mm/yyyy to mm/dd/yyyy
2. Date default formatted 'dd/mm/yyyy'
3. Date formatted 'dd/mm/yyyy'
4. Date problems dd/mm/yyyy mm/dd/yyyy in Access
5. dateformat (dd.mm.yyyy vs. mm.dd.yyyy)
6. Dates...DD.MM.YYYY to MM/DD/YYYY
7. Format('yyyy/mm', date) in SQL Server