Ganesh2VL

How to retrieve/convert current month as MMM format?

5 posts in this topic

#1 ·  Posted

Dears, 

Please guide,I am using the below code to convert month as MMM format, but somehow its not working on production server(variable used without being declared).

StringUpper(_DateToMonth(@MON, $DMW_SHORTNAME)).

 

Thanks

VL.ganesh

Share this post


Link to post
Share on other sites



#2 ·  Posted (edited)

Ganesh2VL,

You probably need to add #include <Date.au3> at the top of your script.

In future please post in General Support for general support questions - the Developer General Discussion section  does clearly say: 

Quote

If it's super geeky and you don't know where to put it - it's probably here

And I would certainly not count this as a "super geeky" question.

M23

Edit: And I see I have moved several of your threads before this one, so please take this point to heart.

Edited by Melba23

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

#3 ·  Posted

15 hours ago, Melba23 said:

Ganesh2VL,

You probably need to add #include <Date.au3> at the top of your script.

In future please post in General Support for general support questions - the Developer General Discussion section  does clearly say: 

And I would certainly not count this as a "super geeky" question.

M23

Edit: And I see I have moved several of your threads before this one, so please take this point to heart.

Sure, Will create new ticket in General Support.

Header  #include <Date.au3> is already in place,  moreover the same script running perfectly from another system.

I am thinking the issue related with PC datetime format? So is there any other way to achieve the same.

 

Thanks 

 

Share this post


Link to post
Share on other sites

#4 ·  Posted

You could try this

 

$var = StringUpper(_DateToMonthShort(@MON))

MsgBox(0, "", $var)


Func _DateToMonthShort($month)

    Switch $month
        Case 01
            Return "Jan"

        Case 02
            Return "Feb"

        Case 03
            Return "Mar"

        Case 04
            Return "Apr"

        Case 05
            Return "May"

        Case 06
            Return "Jun"

        Case 07
            Return "Jul"

        Case 08
            Return "Aug"

        Case 09
            Return "Sep"

        Case 10
            Return "Oct"

        Case 11
            Return "Nov"

        Case 12
            Return "Dec"

        Case Else
            Return ""

        EndSwitch
EndFunc

 

Not the prettiest solution but should work on every computer.

Share this post


Link to post
Share on other sites

#5 ·  Posted

20 minutes ago, Floops said:

You could try this

 

$var = StringUpper(_DateToMonthShort(@MON))

MsgBox(0, "", $var)


Func _DateToMonthShort($month)

    Switch $month
        Case 01
            Return "Jan"

        Case 02
            Return "Feb"

        Case 03
            Return "Mar"

        Case 04
            Return "Apr"

        Case 05
            Return "May"

        Case 06
            Return "Jun"

        Case 07
            Return "Jul"

        Case 08
            Return "Aug"

        Case 09
            Return "Sep"

        Case 10
            Return "Oct"

        Case 11
            Return "Nov"

        Case 12
            Return "Dec"

        Case Else
            Return ""

        EndSwitch
EndFunc

 

Not the prettiest solution but should work on every computer.

 

Thanks a lot

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now