Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Date Format
Message
From
27/10/2006 03:27:18
 
 
To
27/10/2006 03:19:08
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
01164913
Message ID:
01164917
Views:
14
>now the date format is 23-10-2006,
>my client want it to be 23-Oct-2006
>Any simple method to do ??

I do not have the code in VFP, but this code in VB.NET is pretty much straight forward:
        ' Return a date in a medium format
        ' expD1 Date
        ' expN1 Language
        Public Function DateMedium(ByVal tdDate As Date, Optional ByVal tnLanguage As Integer = 1) As String
            Dim lcDate As String = ""
            Dim lcMonth As String = ""
            Dim lnDay As Integer = 0
            Dim lnLanguage As Integer = 0
            Dim lnMonth As Integer = 0
            Dim lnYear As Integer = 0
            lnDay = tdDate.Day
            lnMonth = tdDate.Month
            lnYear = tdDate.Year
            lcMonth = oApp.aMonth(lnMonth, lnLanguage)
            lcDate = lnDay.ToString.PadLeft(2, "0") + "-" + Mid(lcMonth, 1, 3) + "-" + Trim(lnYear.ToString)
            Return lcDate
        End Function
You simply need to create an array of each month in their three letter format. The second column of the array is for the language.
Michel Fournier
Level Extreme Inc.
Designer, architect, owner of the Level Extreme Platform
Subscribe to the site at https://www.levelextreme.com/Home/DataEntry?Activator=55&NoStore=303
Subscription benefits https://www.levelextreme.com/Home/ViewPage?Activator=7&ID=52
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform