01 2022 档案

golang时间戳与格式化字符串的相互转化
摘要:获取时间戳,根据时间戳转化为固定格式的字符串格式 getTimeStamp := time.Now().Unix() // int64 formatTime := time.Unix(getTimeStamp, 0).Format(time.RFC3339) fmt.Println(formatTi 阅读全文

posted @ 2022-01-21 16:58 进击的davis 阅读(933) 评论(0) 推荐(0)

golang 常用数据类型转换
摘要:str ↔ int num := 123 num2Str := strconv.Itoa(num) fmt.Printf("%T", num2Str) str := "12345" str2Int, _ := strconv.Atoi(str) fmt.Printf("%T", str2Int) s 阅读全文

posted @ 2022-01-18 17:09 进击的davis 阅读(90) 评论(0) 推荐(0)

python中各数据类型的转换-整型/浮点型/str型/char型/list型/dict型
摘要:str → int/float/list # 整型数字的字符串转化为数字 int/float strInt = "123" # str -> int strInt2Int = int(strInt) # str -> float strInt2Float = float(strInt) # 小数的字 阅读全文

posted @ 2022-01-18 16:39 进击的davis 阅读(1248) 评论(0) 推荐(0)

导航