Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Getting the first month day.
Message
From
22/06/2001 09:05:19
 
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00522336
Message ID:
00522373
Views:
10
Whooops!

My date format is YYYY/MM/DD. Change the code as follows


>If the parameter is a date field
>
>
>function FirstDayOfMonth
>    lpar tdVar
>    local lcWasDateFormat, llWasCentury, lcReturn
>    assert vartype(tdVar) = 'D'
>
>    lcWasDateFormat = set('date')
>    llWasCenturyOn = set('century') = 'ON'
>    set century on
<b>    set date to DMY</b>
>
>    lcReturn = transform(tdVar - day(tdVar) + 1, '@D')
>
>    set date to &lcWasDateFormat
>    if not llWasCenturyOn
>        set century off
>    endif
>    return lcReturn
>endfunc
>
>
>>Hello at alls.
>>I wonder to know with one the way to get the first month day since any date and in format DD/MM/YYYY.
>>TIA
Previous
Reply
Map
View

Click here to load this message in the networking platform