Bru*_*ado 0 grails simpledateformat
我有以下代码来格式化日期:
def currentDate = new Date().format('E, dd MMM yyyy')
Run Code Online (Sandbox Code Playgroud)
格式如我所料,但它是用我的电脑语言编写的.我怎样才能用英文给出日期?有帮助吗?谢谢!
如果您在Controller的上下文中运行,我建议您使用
def currentDate = new Date()
def formattedDate = g.formatDate(date:currentDate, format: 'E, dd MMM yyyy')
Run Code Online (Sandbox Code Playgroud)