使用 Google Sheets 以编程方式格式化日期和时间

Format date and time programmatically with Google Sheets

我有一个包含以下内容的单元格:

=CONCATENATE("This is a date formatted manually: ", 'Master sheet'!B3,"hrs of the following date:", 'Master sheet'!B3, " AND THIS IS IT ")

单元格 B3 包含一个日期。输出应该是:

This is a date formatted manually 2230hrs of the 31/12/2019 AND THIS IS IT 

我可以找到使用 Google 表格设置日期格式的方法,但您实际上是如何从公式中做到这一点的?

如果我将文件另存为 Excel,可以吗?

="This is a date formatted manually: "&TEXT('Master sheet'!B3,"hhmm")&
 "hrs of the following date: "&TEXT('Master sheet'!B3, "dd/mm/yyyy")&" AND THIS IS IT"


是的,Excel 确实支持 TEXT 公式: