|
| ||||||||||
| Tags: c sharp language, class, file handle, function, main, object |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| c# function equivalent to gettime function in javascript
I am working on one live project where I am using javascript. In my project I want to create c# function which equivalent to gettime() function in javascript. I tried various method, but none of them worked out. Can anyone tell me how to create c# function equivalent to gettime function in javascript? Please help me. Thank you. |
|
#2
| ||||
| ||||
| Re: c# function equivalent to gettime function in javascript
Hey you have to use following code to do this. Code: var uniques = ds.getTime() + '' + Maths.floor(1000 * Maths.random()); Code: string vala2; Random rana=new Random(); int number=rana.Next(0,1250); vala2 = (inta) Matha.Floor(number); |
|
#3
| ||||
| ||||
| Re: c# function equivalent to gettime function in javascript
As per my information NET file has the DateTime object and that's why you are getting such type of problem. In this case you have to use DateTime to get current Date and Time. It is very simple to use and implement. You also have to use the ToString() method to return your specific format in your code.
__________________ Grand Theft Auto 4 PC Video Game |
|
#4
| ||||
| ||||
| Re: c# function equivalent to gettime function in javascript
As per my information you have to provide particular format to tostring() to get rid out of this problem. This format must be equivalent to gettime() in javascript. You can do this in following ways. Code: string valas2; Random ransa=new Random(); int number=ransa.Next(0,1250); valas2 = (inta) Maths.Floor(number);
__________________ The FIFA Manager 2009 PC Game |
|
#5
| ||||
| ||||
| Re: c# function equivalent to gettime function in javascript
I have use one function in the following code which is equivalent to gettime function in javascript. Just try to understand it. In the following code I have use Int64 GetTime() to get proper result. Just try to understand it. Code: private Int64 GetTimes() {
Int64 retvals=0;
DateTime sts=DateTimes(1970,1,1);
TimeSpan tss= (DateTimes.Now-sts);
retvals= (Int64)(ts.TotalMilliseconds+0.5)
return retvals;
} |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "c# function equivalent to gettime function in javascript" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| c++ equivalent function to the c-function 'sprintf | Dilbert | Software Development | 6 | 13-12-2011 03:03 PM |
| C# Equivalent Of Javascript's Location.replace() Function? | ASHER | Software Development | 6 | 16-05-2010 01:20 AM |
| Javascript isNull function | Chrisch | Software Development | 3 | 11-11-2009 01:51 PM |
| How to implement the INITCAP equivalent function in SQL Server | TechPredator | Software Development | 3 | 06-08-2009 03:33 PM |
| JavaScript function help | suseman | Software Development | 3 | 26-05-2009 05:11 AM |