473,324 Members | 2,179 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,324 software developers and data experts.

how to do a calender/timestamp in c++??

i have a few question to ask/discuss

1)hi i would like to know which method is best to make a program that runs day,month, year? i tried to use switch case but its just too long and complicated which make me stop doing it. i want to know is there any other ways? im using visual c++ program.

2)how to seperate name,timestamp,account number, etc in an order way using fobj?
Expand|Select|Wrap|Line Numbers
  1.  example:
  2. name              timestamp           account number        .......
  3. andrew           021307123241      1203455982753
  4.  
because now i print is in andrew,021307123241,1203455982753,.....
how to seperate it?

3)can i know how to clear screen? coz im doin a baking transaction its kinda messy so i would like to clear screen.

thanks for your help!!appreciate it lots!!
Feb 13 '07 #1
4 4810
sicarie
4,677 Expert Mod 4TB
i have a few question to ask/discuss

1)hi i would like to know which method is best to make a program that runs day,month, year? i tried to use switch case but its just too long and complicated which make me stop doing it. i want to know is there any other ways? im using visual c++ program.

2)how to seperate name,timestamp,account number, etc in an order way using fobj?
Expand|Select|Wrap|Line Numbers
  1.  example:
  2. name              timestamp           account number        .......
  3. andrew           021307123241      1203455982753
  4.  
because now i print is in andrew,021307123241,1203455982753,.....
how to seperate it?

3)can i know how to clear screen? coz im doin a baking transaction its kinda messy so i would like to clear screen.

thanks for your help!!appreciate it lots!!
1) I'm not sure I understand your first question. Are you trying to create your own timestamp for whatever time (say when a transaction is run), or are you trying to get a program to run at a regular time (have something in Windows or Linux that runs it regularly)?

2) Have you looked into input file streams? That might work, or if you know the delimiter they are being read in by, you can parse the string for that delimiter (I remember my teacher saying something about strtok(), but I can't remember if it was good or bad. I'm sure if you google it you will find articles suggesting either/both and alternatives), and break it up like that.

3) Will the 'system("CLS");' command work to clear your screen? (I believe you need to include stdlib.h)
Feb 14 '07 #2
1) sry for not explaining it clearer. yup i want user to input the timestamp. which include day,month,year,hour,min,sec in 12 digits but i need to make some condition for it. is there any other way to do instead of using switch case? coz switch case is really long. any sugestion?

2) ok will try to search for a way to do it.

3)the 'screen("CLS")'; cant work is there any other way?im using visual c++ 6.0!!

new Q
4)i declare char for name and i want to make a condition which is upper case and lower case of alphabet only can type in cin else it will print error messege!!!how can i do this i tryied using isalpah but still cant only can check for 1st letter but the rest it cant check!!need some new ideas and solution!!

thanks in advance for those who helped me
Feb 14 '07 #3
sicarie
4,677 Expert Mod 4TB
1) sry for not explaining it clearer. yup i want user to input the timestamp. which include day,month,year,hour,min,sec in 12 digits but i need to make some condition for it. is there any other way to do instead of using switch case? coz switch case is really long. any sugestion?
I'm actually attempting to do the same thing right now with Java. I am having the user input the information in a pre-defined format, and then using Java's tools to convert that into a date. If you want to do a google search on 'c++ date library' or just 'c++ date' you might find something that will do roughly the same. (Does anyone else know a good way to do this - I'm interested as well!)


3)the 'screen("CLS")'; cant work is there any other way?im using visual c++ 6.0!!
I'm a Linux person myself, and don't know another method in VC++, does anyone else?

new Q
4)i declare char for name and i want to make a condition which is upper case and lower case of alphabet only can type in cin else it will print error messege!!!how can i do this i tryied using isalpah but still cant only can check for 1st letter but the rest it cant check!!need some new ideas and solution!!

thanks in advance for those who helped me
Ok, once again, not sure I understand you - you mention that you declared a 'char' which is, by definition, only one letter. You might try a pointer to a char, that way you can see the whole string, and then just increment the pointer. As for other line-reading functions, you might consider getline(). Is that what you are looking for, or can you rephrase your question?
Feb 14 '07 #4
thanks sicarie for the help but i still cant find a suitable way to solve the problem seems like u and me is doin the same but ur doin in java and me in c++ so can any1 please help us with this timestamp thinggy?

thanks a million in advance
Feb 15 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: jason | last post by:
Hi Everyone, I would really appreciate some thoughts on how best to tackle an availability calender in ASP for our yacht fleet. I need to be able to show the booking STATUS of a particular...
8
by: PerryC | last post by:
I want to be able to accomplish this, please help: When click on the DOB field, a ActiveX Calender popup and the user choose a date, the value is automatically refreshed in the DOB field in the...
0
by: Steve Peterson | last post by:
Hi I have a web app running on WinXP Pro which has the OS's operating system's regional settings set to "Spanish - Spain". I have a web app running on this computer that one page has a calender...
4
by: Chris | last post by:
Hi, I am trying to create a popup calender so a user can click on a button on the main form, a calender will then popup, the user will select a date and then click ok on the popup. The date will...
0
by: Steven Blair | last post by:
Hi, I would like to create a Calender effect like this website: http://www.expedia.co.uk/default.aspx This site uses ASP.NET, so I guess we should be able to use VS 2005 to recreate this. ...
0
by: kalichakradhar | last post by:
hi all, hi, I am developing a application which would open the shared calender of outlook and read the meeting notices and also modifies the meeting notice from Vb.I am successful in opening the...
7
by: gubbachchi | last post by:
Hi all, In my application I need to display the data fetched from mysql database after the user selects date from javascript calender. I have written the code in which after the user selects the...
21
Vkas
by: Vkas | last post by:
i had created my own web calender control!!!! it consist 1} text box (it display's the selected date) 2} button (it hide and show the calender control) 3} calender control (use for the selection...
1
by: xtremebass | last post by:
Hello Bytes, i have a calender program which is created by using Javascript. when i execute that program using Internet Explorer,it works properly but when i tried in Mozilla firefox it didnt...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.