Jump to content

Recommended Posts

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

  • Moderators
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

Expand  

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:

  Reveal hidden contents

 

Posted
  On 4/4/2017 at 1:30 PM, 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.

Expand  

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 

 

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.

Posted
  On 4/5/2017 at 5:45 AM, 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.

Expand  

 

Thanks a lot

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
  • Recently Browsing   0 members

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