DateAdd() in Special Format

后端 未结 3 643
星月不相逢
星月不相逢 2020-12-07 06:02

I\'ve tried all the ways I see to add a month to a certain date then return that in a specific format but I\'m at a loss. Here\'s my code but I need to format it:

3条回答
  •  臣服心动
    2020-12-07 06:45

    The following should work perfect:

    replace( formatdatetime( dateadd( "m" , 1 , cDate(request("date")) ), 0 ) , "/" , "-" )
    

    Notice the use of the cDate function to convert a value to a date explicitly.

    Edit:

    I removed last part of your code & "' ), it gave me an error otherwise.

提交回复
热议问题