gpt4 book ai didi

ios - 如何在 Swift 中将日期转换为字符串

转载 作者:可可西里 更新时间:2023-10-31 23:57:24 25 4
gpt4 key购买 nike

<分区>

我正在尝试调用一个函数,一个参数是当前时间和日期,另一个是文件名,它们都是字符串。如何将 Date() 转换为字符串。我试过:

writeToFile(content: Date(), fileName: "jm.txt")

但它给了我错误:

Cannot convert value of type 'Date' to expected argument type 'String'

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com