当前位置:网站首页>String类型转换BigDecimal、Date类型
String类型转换BigDecimal、Date类型
2022-07-01 20:21:00 【全栈程序员站长】
大家好,又见面了,我是你们的朋友全栈君。
String类型转换BigDecimal类型
public static void main(String[] args) { String str1=”2.30″; BigDecimal bd=new BigDecimal(str1); System.out.println(bd); } Java String类型转换成Date日期类型
插入数据库时,存入当前日期,需要格式转换
import java.text.SimpleDateFormat;
formatter = new SimpleDateFormat( "yyyy-MM-dd ");
String date = formatter.format(new Date());//格式化数据,取当前时间结果为 2014-10-30
String格式的数据转化成Date格式
import java.text.SimpleDateFormat;
formatter = new SimpleDateFormat( "yyyy-MM-dd ");
String s = "2011-07-09 ";
Date date = formatter.parse(s);
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/147198.html原文链接:https://javaforall.cn
边栏推荐
- 同花顺股票开户选哪个券商好手机开户是安全么?
- Détection des cibles - série Yolo
- Myslq ten kinds of locks, an article will take you to fully analyze
- 8K HDR!| Hevc hard solution for chromium - principle / Measurement Guide
- Items in richview documents
- Optimization of the problem that the request flow fails to terminate during page switching of easycvr cluster video Plaza
- Target detection - Yolo series
- [mysql] install mysql5.7
- How can I know if I want to get the preferential link of stock account opening? Is it safe to open an account online?
- 个人炒股怎样开户?安全吗。
猜你喜欢
东哥套现,大佬隐退?
Optimization of the problem that the request flow fails to terminate during page switching of easycvr cluster video Plaza
NSI脚本的测试
[mysql] install mysql5.7
PWN攻防世界cgpwn2
新版图解网络PDF即将发布
天气预报小程序源码 天气类微信小程序源码
leetcode刷题:二叉树01(二叉树的前序遍历)
Niuke programming question -- must brush the string of 101 (brush the question efficiently, draw inferences from one instance)
PMP与NPDP之间的区别是什么?
随机推荐
合成大西瓜小游戏微信小程序源码/微信游戏小程序源码
leetcode刷题:栈与队列01(用栈实现队列)
九章云极DataCanvas公司蝉联中国机器学习平台市场TOP 3
编译原理复习笔记
Items in richview documents
BPR(贝叶斯个性化排序)
随机头像大全,多分类带历史记录微信小程序源码_支持流量主
网上开户是安全的吗?新手可以开炒股账户吗。
PHP gets the external chain address of wechat applet and applet store
4. 对象映射 - Mapping.Mapstercover
《软件工程导论(第六版)》 张海藩 复习笔记
三菱PLC FX3U脉冲轴点动功能块(MC_Jog)
Learn white box test case design from simple to deep
能升职加薪?PMP证书含金量浅析
Myslq ten kinds of locks, an article will take you to fully analyze
收藏:存储知识全面总结
面试题:MySQL的union all和union有什么区别、MySQL有哪几种join方式(阿里面试题)[通俗易懂]
Iframe parent-child page communication
新牛牛盲盒微信小程序源码_支持流量变现,带完整素材图片