473,322 Members | 1,379 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,322 software developers and data experts.

CTime equivalent in C#

L
Hi,

In C++ the code below sets CurrentMainFrameTime to 1111635540

intMFMonth = 3;
intMFDay = 23;
intMFHour = 19;
intMFMin = 39;

CTime
CurrentMainFrameTime(CTime::GetCurrentTime().GetYe ar(),intMFMonth,intMFDay,intMFHour,intMFMin,0);

How can I achieve the same in C#.

Thanks,
Lalasa.

Nov 17 '05 #1
1 6630
This would be done using DateTime (which incidently is a .Net data type, not
just for C#).

DateTime snappedDate = DateTime.Now;

string snappedString = snappedDate.ToString ( "dd MMM yyyy HH:mm:ss" );

DateTime specificDate = DateTime.Parse("12 Jun 2004 13:23:32");
"L" <la********@investors.com> wrote in message
news:11*********************@l41g2000cwc.googlegro ups.com...
Hi,

In C++ the code below sets CurrentMainFrameTime to 1111635540

intMFMonth = 3;
intMFDay = 23;
intMFHour = 19;
intMFMin = 39;

CTime
CurrentMainFrameTime(CTime::GetCurrentTime().GetYe ar(),intMFMonth,intMFDay,intMFHour,intMFMin,0);

How can I achieve the same in C#.

Thanks,
Lalasa.

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kevin | last post by:
Hello: I am trying to find documentation on using the ctime library as I need to be able to instantiate an object to keep track of the time when a certain event occurs. I also need to be able...
1
by: wukexin | last post by:
I write my own class Cfile, I want to know what about implement ctime().Who help me? My use function ctime, I sign it with $$$. my class Cfile: #------------------------ file.h...
5
by: berkay | last post by:
long num,num1; char *first; char *last; num=ilk.getTime();//gets time first=ctime(&num); cout.flush(); fflush(stdin); 1) cout<<"first:"<<first;
2
by: Hao Xu | last post by:
Hi everyone! I think that everyone knows ctime() in glibc: The ctime(), gmtime() and localtime() functions all take an argument of data type time_t which represents calendar time. When ...
2
by: Chris | last post by:
Hello, How can i convert a C++ CTime (4 bytes) into a C# DateTime ? (my CTime is read in a file). Thanks, -- Chris
4
by: Gary Wessle | last post by:
Hi I am not getting current time with this program, what am I doing wrong? #include <ctime> #include <iostream> using namespace std; #define P(x) cout << #x " = " << (x) << "\n";
11
by: aisling.cronin | last post by:
Hi I am using ctime to convert the following string 1144412677847 .... Please could some one to double check if they get the same result as me (The Time is Sun Nov 02 09:11:51 2031). It seems...
8
by: Pietro Cerutti | last post by:
Hi to all, I'm just curious about the rationale of having ctime() put a new line character at the end of its return value, as: "Thu Nov 24 18:22:48 1986\n\0" Personally, I find it stupid and...
4
by: Pietro Cerutti | last post by:
Hi group, #include <stdio.h> #include <unistd.h> #include <time.h> int main(void) { time_t t1, t2; char *st1, *st2;
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
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: 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
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.