20240301_JSEQ_upperpc/JiangsuEarthquake/JiangsuEarthquake/Common/DateTimeConverter.cs
春风过客 e17cf9ebf6 新增功能:
1 解决FTP路径选取和路径确认无法成功的问题;
2 研究正则表达式,解决无法正确获取到FTP目录中文件和文件夹的修改日期的问题;
3 测试FTP上传下载功能;
2024-05-27 18:32:24 +08:00

29 lines
810 B
C#

using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;
namespace JiangsuEarthquake.Common
{
public class DateTimeConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is DateTime dateTime)
{
// 使用自定义的时间格式,例如:"yyyy-MM-dd HH:mm:ss"
return dateTime.ToString("yyyy/MM/dd");
}
return value;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}