简体   繁体   English

转换日期格式,BMC Remedy/smart-it

[英]Convert date format, BMC Remedy/smart-it

Problem: In a field called $Detailed Decription$ sometimes dateformat 08/09/2021 is enterd and this need to be converted to swedish format 2022-02-11问题:在名为 $Detailed Description$ 的字段中,有时会输入日期格式 08/09/2021,这需要转换为瑞典语格式 2022-02-11

I'am going to use BMC Developer studio and make a filter but i cant find a fitting solution for it.我打算使用 BMC Developer studio 制作一个过滤器,但我找不到合适的解决方案。 Replacing it wont work (i think) becaus it need to have a value to replace it with.替换它不会起作用(我认为),因为它需要有一个值来替换它。

Maby there can be a function that reads regex (\d{2})/(\d{1,2})/(\d{4}) but how can i convert it? Maby 可以有一个 function 读取正则表达式 (\d{2})/(\d{1,2})/(\d{4}) 但我如何转换它?

If it's sometimes - look at AR System User Preferencje form.如果有时 - 查看 AR System User Preferencje 表格。 Check certain user's locale and date time config.检查特定用户的语言环境和日期时间配置。 Also is important where the data comes from.数据的来源也很重要。 Could be a browser setting or java script mod.可能是浏览器设置或 java 脚本模块。

1- Using Set fields action, copy the date value from Detailed Description to a Date/Time field (ie z1D_DateTime01). 1- 使用设置字段操作,将日期值从详细说明复制到日期/时间字段(即 z1D_DateTime01)。

2- Using Set fields action and Functions (MONTH, YEAR, DAY, HOUR, MINUTE, SECOND) you can parse the date/time and convert it to format you like. 2- 使用设置字段操作和函数(月、年、日、小时、分钟、秒),您可以解析日期/时间并将其转换为您喜欢的格式。

Something like this:像这样:

SwedishDate = YEAR($z1D_DateTime01$) + "-" + MONTH($z1D_DateTime01$) + "-" + DAY($z1D_DateTime01$) SwedishDate = YEAR($z1D_DateTime01$) + "-" + MONTH($z1D_DateTime01$) + "-" + DAY($z1D_DateTime01$)

This will capture the parts of date and combine them with "-" in the middle and in the order you want.这将捕获日期的部分并将它们与中间的“-”按您想要的顺序组合起来。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM