是否有替代方案来编写时间戳? [英] Is there an alternative to program a timestamp?

查看:73
本文介绍了是否有替代方案来编写时间戳?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,


我想知道是否还有其他方法可以做一个包含日期和时间的时间戳!!下面是我已经创建的一个程序,但它太长了,我想知道其他方法可以帮助我吗?


这里是程序的一部分我创造了它不可能向你们展示整个程序,因为我将它复制到保存在记事本中,它的文件是64kb !!请告诉我是否有其他替代方案来做这个程序?

hi all,

i''m wondering is there any other alternative to do a timestamp which consists of date and time!! below is a program i''ve created but its too long and to large i would like to know other way to do it can anyone help me?

here is some part of the program i''ve created its impossible to show u guys the whole program as ive copy it to save in a notepad and its file is 64kb!!please tell me if there is other alternative to do this program??

展开 | 选择 | Wrap | 行号

推荐答案

嗨。对于让用户输入日期,这似乎是一个非常漫长的方法。代码的目的是什么?
Hi. This does seem to be a very long winded method for getting a user to input a date. What is the purpose of the code?



嗨。对于让用户输入日期,这似乎是一个非常漫长的方法。代码的目的是什么?
Hi. This does seem to be a very long winded method for getting a user to input a date. What is the purpose of the code?



感谢willa的回复


是的,确实是一个冗长的方法,这就是为什么我试图找出有没有其他方式你可以做到!!


该程序基本上需要用户键入ddmmyyhhnnss中的日期和时间(d =天,m =月,y =年,h =小时,n = min,s = s ec)其中一天必须具有01-31 / 28/30的条件并且其余为soo因此我能想到的oni方式是使用开关盒,结果是方式太长了!!所以有没有其他方法可以做到这一点?


感谢您的帮助,感谢它很多!!

thanks willa for replying

yes indeed its a long winded method that is why im trying to find out is there any other way u can do it!!

the program basically need the user to keyin the date and time in ddmmyyhhnnss(d=day,m=month,y=year,h=hour,n=min,s=s ec) where the day must have a condition which is 01-31/28/30 and soo on for the rest therefore the oni way i can think off is using switch case which turn out to be way too long!!so is there any other way to do this??

thanks for ur HELP appreciate it alots!!


似乎在代码中重复出现。因为你需要多次写同样的东西,考虑使用一个函数。


你可能想创建一个选择月份天数的函数,即
There seems to be significant repetition in the code. As soo as you need to write the samething several times, consider using a function.

You may like to create a function that selects number of days in the month viz
展开 | 选择 | Wrap | 行号


这篇关于是否有替代方案来编写时间戳?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆