Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to Convert 18AUG04 to 08/18/2004
Message
De
18/08/2004 11:42:43
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
18/08/2004 11:07:08
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00934126
Message ID:
00934141
Vues:
18
>Hello,
>
>How to convert the date from
>
>18AUG04 to become 08/18/2004
>
>tia
Function Str2Date
  Lparameters tcStr
  Local lcMonth, lnDay, lnMonth, lnYear
  lcMonth = Chrtran(m.tcStr,'1234567890','')
  lnDay  = Val(m.tcStr)
  lnYear = Year(Ctod('1/1/'+;
    substr(m.tcStr,Atc(m.lcMonth,m.tcStr)+Len(m.lcMonth))))
  If Len(m.lcMonth) < 3 ;
  	or m.lnDay = 0 ;
  	or m.lnYear = 0
  	return {}
  endif
  For lnMonth=1 To 12
    If Upper(Cmonth(Date(2000,m.lnMonth,1))) = m.lcMonth
      Return Date(m.lnYear, m.lnMonth, m.lnDay)
    Endif
  Endfor
  Return {}
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform