当前位置:网站首页>Learn the method code example of converting timestamp to uppercase date using PHP
Learn the method code example of converting timestamp to uppercase date using PHP
2022-07-02 15:07:00 【Lingering memory of Yu Fei】
Learn to use php Method code example of converting timestamp to uppercase date
design sketch
Current date in lowercase -----2022-06-27 17:45:25
The current date is capitalized ----- Two 〇 June 27, 2002
The current date is capitalized ----- June 27, 2002
Encapsulation method
function dateTimeToUpper($stamp, $type)
{
$year = str_split(date('Y', $stamp));
$month = intval(date('m', $stamp));
$day = intval(date('d', $stamp));
$chars = array(
0 => ['〇', ' zero '],
1 => [' One ', ' one '],
2 => [' Two ', ' Ii. '],
3 => [' 3、 ... and ', ' 3 '],
4 => [' Four ', ' boss '],
5 => [' 5、 ... and ', ' wu '],
6 => [' 6、 ... and ', ' lu '],
7 => [' 7、 ... and ', ' Retailer, '],
8 => [' 8、 ... and ', ' '],
9 => [' Nine ', ' nine '],
10 => [' Ten ', ' Ten '],
11 => [' 11、 ... and ', ' Ten '],
12 => [' Twelve ', ' twelve '],
13 => [' 13、 ... and ', ' Thirteen '],
14 => [' fourteen ', ' Forty four '],
15 => [' 15、 ... and ', ' fifteen '],
16 => [' sixteen ', ' sixteen '],
17 => [' seventeen ', ' seventeen '],
18 => [' eighteen ', ' eighteen '],
19 => [' nineteen ', ' nineteen '],
20 => [' twenty ', ' twenty '],
21 => [' The 21st ', ' Twenty one '],
22 => [' Twenty-two ', ' twenty-two '],
23 => [' 23 ', ' twenty-three '],
24 => [' Twenty-four ', ' Twenty four '],
25 => [' twenty-five ', ' Twenty five '],
26 => [' hexacosa- ', ' Twenty six '],
27 => [' twenty-seven ', ' Twenty seven '],
28 => [' Twenty-eight ', ' Twenty eight '],
29 => [' Twenty-nine ', ' Twenty nine '],
30 => [' thirty ', ' thirty '],
31 => [' Thirty-one ', ' Thirty one '],
);
$date = '';
foreach ($year as $y) {
$date .= $chars[$y][$type];
}
$date .= ' year ';
$date .= $chars[$month][$type] . ' month ';
$date .= $chars[$day][$type] . ' Japan ';
return $date;
}
echo ' Current date in lowercase ==' . $now_time = date('Y-m-d H:i:s', time());
echo '<br>';
echo ' The current date is capitalized = The first style =' . dateTimeToUpper(time(), 0);
echo '<br>';
echo ' The current date is capitalized = The second style =' . dateTimeToUpper(time(), 1);
echo '<br>';
边栏推荐
- [QNX Hypervisor 2.2用户手册]6.3 Guest与外部之间通信
- 使用mathtype编辑公式,复制粘贴时设置成仅包含mathjax语法的公式
- C thread transfer parameters
- How does CTO help the business?
- [noi Simulation Competition] scraping (dynamic planning)
- AtCoder Beginner Contest 254
- Mavn 搭建 Nexus 私服
- 原则、语言、编译、解释
- 【C语音】详解指针进阶和注意点(2)
- C # delay, start the timer in the thread, and obtain the system time
猜你喜欢
【C语音】详解指针进阶和注意点(2)
. Net core logging system
Large top heap, small top heap and heap sequencing
【apipost】使用教程
fatal: unsafe repository is owned by someone else 的解决方法
Makefile 分隔文件名与后缀
报错:npm WARN config global `--global`, `--local` are deprecated. Use `--location=global` instead.
[C language] explain the initial and advanced levels of the pointer and points for attention (1)
Solve the problem that El radio group cannot be edited after echo
mathjax 入门(web显示数学公式,矢量的)
随机推荐
Reuse and distribution
微信小程序使用towxml显示公式
vChain: Enabling Verifiable Boolean Range Queries over Blockchain Databases(sigmod‘2019)
Why can't browsers read JSX?
广州市应急管理局发布7月高温高湿化工安全提醒
牛客练习赛101
How does CTO help the business?
CodeCraft-22 and Codeforces Round #795 (Div. 2)D,E
表格响应式布局小技巧
用户隐私协议有些汉字编码不规范导致网页显示乱码,需要统一找出来处理一下
Error: NPM warn config global ` --global`, `--local` are deprecated Use `--location=global` instead.
MFC 定时器使用
It's no exaggeration to say that this is the most user-friendly basic tutorial of pytest I've ever seen
记一次报错解决经历依赖重复
LeetCode_字符串_简单_412.Fizz Buzz
C#延时、在线程中开启定时器、获取系统时间
fatal: unsafe repository is owned by someone else 的解决方法
ONNX+TensorRT:将预处理操作写入ONNX并完成TRT部署
MFC console printing, pop-up dialog box
Map介绍