简体   繁体   English

如何在打字稿中将字符串转换为日期格式

[英]How to convert string into date formate in typescript

This is my HTML: 这是我的HTML:

label for="simple-input" class="Label">{{item.name}}</label> 
<input type="date" class="Input" id="exampleInputName" value="new Date([value.valuwwe])">

Here is my JSON: 这是我的JSON:

{
    "name": "Date Field",
    "namessId": 8717,
    "category": "Date Field",
    "categsssoryId": 8718,
    "descrssiption": "Date Field",
    "descriptionId": 8716,
    "specreType": 5,
    "maxValue": "6/7/2017 12:00:00 AM",
    "minValue": "6/7/2017 12:00:00 AM",
    "value": {
        "valuwwe": "01/01/0001 00:00:00",
        "vasslueId": 8719,
        "scssvId": 1007,
        "isDesfault": false
}

I am using new date() , but its not working. 我正在使用new date() ,但无法正常工作。

在您的HTML中,尝试

< ... value="new Date(item.value.valuwwe)">

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

相关问题 如何将日期格式转换为其他格式 - How to convert date format into different formate 如何在javascript中将日期一个格式转换为另一个格式? - how to convert date one formate to another in javascript? 如何将存储在变量中的日期转换为 jquery 中的日期格式? - how to convert the date stored in a variable in to a date formate in jquery? MomentJs:如何在Typescript中将字符串转换为日期? - MomentJs: How to convert string to date in Typescript? 如何验证其中包含时区的日期字符串的格式? - How can I validate the formate of a date string that has timezone in it? 如何在javascript中设置Date formate? - How to set Date formate in javascript? 如何将数字数组转换为日期字符串格式。 打字稿/角度7 - How to convert array of numbers into a date string format. Typescript/Angular 7 如何将“Tue Nov 26 2019 16:00:00 GMT-0800”转换为 .net json 日期格式“\/Date(1574812800000)\/”格式? - how can I Convert “Tue Nov 26 2019 16:00:00 GMT-0800” to .net json date formate “\/Date(1574812800000)\/” formate? 将字符串转换为日期而不考虑时区-Typescript - Convert string to Date without considering timezone - Typescript 如何将对象的 JS 数组转换为不同的格式? - How to convert a JS array of of objects to a different formate?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM