NetBeans Code Templates ${date}?

后端 未结 6 2116
感动是毒
感动是毒 2021-02-14 03:16

I have this code template in Eclipse

@since ${date}

when entered i get something like this :

@since 4.8.2009

6条回答
  •  甜味超标
    2021-02-14 03:32

    Something like the following example should doing the job :

    ${date?date?string("yyyy")}.${date?date?string("MM")}.${date?date?string("dd")}
    
    • yyyy => year on 4 elements (ex: 2012)
    • MM => Month on 2 elements (ex: march -> 03)
    • dd => Day of the month on 2 elements (ex: 23)
    • . => separator you want to separate each fields (ex: - or / or . or smth else) You should have to check about available format somewhere in the netbeans help (sorry I don't find out informations about this for now). I see that's a very old post, but if it may usefull for someone ... regards. ollie314

提交回复
热议问题