Jump to content

How to retrieve/convert current month as MMM format?


Recommended Posts

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

Link to comment
Share on other sites

  • Moderators

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

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 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...