今日e语-7月15日

1. Self-confidence is no blind pride, no imprudent implulsion, no naive imagination, no indiscreet or wild wishes.

    自信不是盲目的骄傲;自信不是鲁莽的冲动;自信不是天真的痴想;自信不是轻率的奢望。

2. The reason for the greatness of reef is that it can stand shocks and produce beautiful flowers among shocks. Let's be reef standing erecting in rip current and bravely greet the challenge in life.

    礁石之所以伟大,是因为它能经得起打击,并能在打击中溅出美丽的花朵。做那昂然屹立于激流中的礁石吧,勇敢地迎接生活的挑战!

3. The truth of life lies in pursuit and the value of life lies in contribution. When you gain something fine, please don't forget to share with the beautiful world.

    人生的真谛在于追求,人生的价值在于奉献,当你追求到一切美好的东西时,请别忘了拿出一片情、一片爱--奉献给这美好的人间!

4. Dreams won't die as life continues.

    生命不止,梦想不灭!

5. If allowing shadow to lead you, you will surely lose the borderline with nightshade.

    如果阴影牵着鼻子,就必定会丧失和夜色的界限。

6. A year's plan is in spring, a day's plan in the morning.

    一年之计在于春,一日之计在于晨。

7. Life is a wordless book, and only through observation, exploration, creation, excavation and penetration can we find the procelain picture hidden within.

    生活是一本无字的书,只有去观察、探索、创造、挖掘、深入,才能发现藏在其中的精美图案!

8. Once you don't lose the feeling of mission and still keep sober mind, never anchor your ship of life in some warm and calm bay. Instead you should sail to the terrifying winds and waves to appreciate the immense beauty in it.

    只要不丧失远大的使命感,还保持着清醒的头脑,就绝不能把生活之船停泊在某一个温暖平静的海湾,而应该重新扬起生活的风帆,驶向生活的惊风骇浪中,去领略其间的无限风光!

9. All setbacks will only give more colors to my life road. Perhaps at the beginning of this road, there is delusion and loneliness, but I will become more self-confidence as I walk down, because at the end of this road paved with love, it will be happiness waiting for me.

    所有的挫折只会把我的人生之路点缀得更加美丽,也许,在这条路的起点,会是迷茫和凄凉,但是我会越走越自信,因为在这条用爱铺成的道路尽头,是一片幸福的天地!

10. Be acquainted  with you so long and deep, even deeper than the depth of sea and clouds.

      与君远相知,不道云海深。

 

#!/system/bin/sh # ANSI 颜色定义 red="\e[31m" green="\e[32m" yellow="\e[33m" blue="\e[34m" magenta="\e[35m" cyan="\e[36m" reset="\e[0m" bold="\e[1m" reset_bold="\e[22m" # 默认目标时间 target="2028-01-01 00:00:00" # 精确期计算函数 calculate_date_diff() { # 获取当前期时间 current_year=$(date +"%Y") current_month=$(date +"%m") current_day=$(date +"%d") current_hour=$(date +"%H") current_minute=$(date +"%M") current_second=$(date +"%S") # 解析目标期时间 target_year=$(echo "$target" | cut -d'-' -f1) target_month=$(echo "$target" | cut -d'-' -f2) target_day=$(echo "$target" | cut -d' ' -f1 | cut -d'-' -f3) target_time=$(echo "$target" | cut -d' ' -f2) target_hour=$(echo "$target_time" | cut -d':' -f1) target_minute=$(echo "$target_time" | cut -d':' -f2) target_second=$(echo "$target_time" | cut -d':' -f3) # 1. 计算年份差 years=$((target_year - current_year)) # 2. 计算月份差(考虑年份进位) months=$((target_month - current_month)) if [ $months -lt 0 ]; then years=$((years - 1)) months=$((months + 12)) fi # 3. 计算天数差(考虑闰年和月份进位) # 计算当前月份的天数 case $current_month in 01|03|05|07|08|10|12) month_days=31 ;; 04|06|09|11) month_days=30 ;; 02) if [ $((current_year % 4)) -eq 0 ] && [ $((current_year % 100)) -ne 0 ] || [ $((current_year % 400)) -eq 0 ]; then month_days=29 else month_days=28 fi ;; esac days=$((target_day - current_day)) if [ $days -lt 0 ]; then months=$((months - 1)) if [ $months -lt 0 ]; then years=$((years - 1)) months=11 fi days=$((days + month_days)) fi # 4. 计算小时差(考虑天数进位) hours=$((target_hour - current_hour)) if [ $hours -lt 0 ]; then days=$((days - 1)) hours=$((hours + 24)) fi # 5. 计算分钟差(考虑小时进位) minutes=$((target_minute - current_minute)) if [ $minutes -lt 0 ]; then hours=$((hours - 1)) minutes=$((minutes + 60)) fi # 6. 计算秒数差(考虑分钟进位) seconds=$((target_second - current_second)) if [ $seconds -lt 0 ]; then minutes=$((minutes - 1)) seconds=$((seconds + 60)) fi # 处理负值(时间已过) if [ $years -lt 0 ] || [ $months -lt 0 ] || [ $days -lt 0 ] || [ $hours -lt 0 ] || [ $minutes -lt 0 ] || [ $seconds -lt 0 ]; then echo "0 0 0 0 0 0" return 1 fi # 计算总天数(用于显示) total_days=$((years * 365 + months * 30 + days)) # 近似值 echo "$years $months $days $hours $minutes $seconds $total_days" return 0 } # 检查目标时间是否已过 check_target() { result=$(calculate_date_diff) if [ $? -ne 0 ]; then echo -e "${red}目标时间已过${reset}" return 1 fi return 0 } # 设置目标时间 set_target() { clear echo -e "${bold}${cyan}===== 设置目标时间 =====${reset}${reset_bold}" # 获取当前时间作为默认值 current_year=$(date +"%Y") current_month=$(date +"%m") current_day=$(date +"%d") current_hour=$(date +"%H") current_minute=$(date +"%M") current_second=$(date +"%S") # 年份验证 while true; do echo -n "请输入年份 (YYYY) [默认 $current_year]: " read year year=${year:-$current_year} if echo "$year" | grep -qE '^[0-9]{4}$'; then break else echo -e "${red}错误: 年份必须是4位数字${reset}" fi done # 月份验证 while true; do echo -n "请输入月份 (1-12) [默认 $current_month]: " read month month=${month:-$current_month} if echo "$month" | grep -qE '^(0[1-9]|1[0-2]|[1-9])$'; then break else echo -e "${red}错误: 月份必须是1-12${reset}" fi done # 期验证 while true; do echo -n "请输入期 (1-31) [默认 $current_day]: " read day day=${day:-$current_day} if echo "$day" | grep -qE '^(0[1-9]|[12][0-9]|3[01]|[1-9])$'; then # 验证期是否有效 case $month in 02) if [ $((year % 4)) -eq 0 ] && [ $((year % 100)) -ne 0 ] || [ $((year % 400)) -eq 0 ]; then max_day=29 else max_day=28 fi ;; 04|06|09|11) max_day=30 ;; *) max_day=31 ;; esac if [ $day -le $max_day ] && [ $day -ge 1 ]; then break else echo -e "${red}错误: $year年$month月最多有 $max_day 天${reset}" fi else echo -e "${red}错误: 期必须是1-31${reset}" fi done # 小时验证 while true; do echo -n "请输入小时 (0-23) [默认 $current_hour]: " read hour hour=${hour:-$current_hour} if echo "$hour" | grep -qE '^([01][0-9]|2[0-3]|[0-9])$'; then break else echo -e "${red}错误: 小时必须是0-23${reset}" fi done # 分钟验证 while true; do echo -n "请输入分钟 (0-59) [默认 $current_minute]: " read minute minute=${minute:-$current_minute} if echo "$minute" | grep -qE '^([0-5][0-9]|[0-9])$'; then break else echo -e "${red}错误: 分钟必须是0-59${reset}" fi done # 秒数验证 while true; do echo -n "请输入秒数 (0-59) [默认 $current_second]: " read second second=${second:-$current_second} if echo "$second" | grep -qE '^([0-5][0-9]|[0-9])$'; then break else echo -e "${red}错误: 秒数必须是0-59${reset}" fi done # 设置目标时间 target="${year}-${month}-${day} ${hour}:${minute}:${second}" if ! check_target; then return 1 fi echo -e "${green}目标时间已设置为: ${cyan}$target${reset}" sleep 2 return 0 } # 主菜单 show_menu() { while true; do clear echo -e "${bold}${magenta}===== 彩色倒计时菜单 =====${reset}${reset_bold}" echo -e "${green}1. 🕰设置目标时间🕰" echo -e "${blue}2. 👀查看倒计时👀" echo -e "${yellow}3. ✨退出程序✨${reset}" echo -e "${bold}${magenta}====Z=====Z=====J======开源${reset}${reset_bold}" echo -n "请选择操作 [1-3]: " read choice case $choice in 1) set_target ;; 2) if check_target; then main_loop else echo -e "${red}请设置有效的目标时间${reset}" sleep 2 fi ;; 3) clear echo -e "${cyan}⭐感谢使用ZJ彩色倒计时程序⭐${reset}" exit 0 ;; *) echo -e "${red}无效选择,请重新输入${reset}" sleep 1 ;; esac done } # 主循环 - 显示精确倒计时 (修复版本) main_loop() { # 初始化时间戳 last_update=$(date +%s.%N) while true; do # 记录循环开始时间 loop_start=$(date +%s.%N) # 获取当前时间 year=$(date +"%Y") month=$(date +"%m") day=$(date +"%d") hour=$(date +"%H") minute=$(date +"%M") second=$(date +"%S") # 计算精确倒计时 result=$(calculate_date_diff) years=$(echo $result | awk '{print $1}') months=$(echo $result | awk '{print $2}') days=$(echo $result | awk '{print $3}') hours=$(echo $result | awk '{print $4}') minutes=$(echo $result | awk '{print $5}') seconds=$(echo $result | awk '{print $6}') total_days=$(echo $result | awk '{print $7}') # 清屏 clear # 显示菜单提示 echo -e "${bold}${magenta}按 [M] 键返回菜单${reset}${reset_bold}" # 输出动态时钟 echo -e "📅${bold}当前时间${reset_bold} ${red}${year}${reset}-${green}${month}${reset}-${blue}${day}${reset} ${cyan}${hour}${reset}:${magenta}${minute}${reset}:${yellow}${second}${reset} ⏰" # 输出精确倒计时 echo -e "⏳${bold}距离目标时间${reset_bold} ${cyan}$target${reset} 还有:" echo -e " 🗓${bold}${red}${years}${reset}${reset_bold}年 ${bold}${green}${months}${reset}${reset_bold}月 ${bold}${blue}${days}${reset}${reset_bold}天" echo -e " ⏱${bold}${magenta}${hours}${reset}${reset_bold}小时 ${bold}${yellow}${minutes}${reset}${reset_bold}分 ${bold}${cyan}${seconds}${reset}${reset_bold}秒" echo -e " 📌总计: ${bold}${red}${total_days}${reset}${reset_bold}天" # 检查按键(非阻塞) if read -t 0.1 -n 1 key; then if [[ $key == "m" || $key == "M" ]]; then return fi fi # 计算本次循环耗时 loop_end=$(date +%s.%N) loop_time=$(echo "$loop_end - $loop_start" | bc) # 计算需要等待的时间(确保1秒间隔) sleep_time=$(echo "1.0 - $loop_time" | bc) # 确保睡眠时间合理 if [ $(echo "$sleep_time > 0" | bc -l) -eq 1 ]; then sleep $sleep_time else # 如果已经超时,最小延迟0.05秒 sleep 0.05 fi done } # 启动程序 show_menu 美化查看时间
最新发布
08-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值