tags:

views:

135

answers:

6

In as3 I'd say

public var time:Number;

How to declare such in C#?

+1  A: 
public long time;

This will create a new variable with the type long and the default value. (0)

jjnguy
Number in AS3 is a data type representing an IEEE-754 double-precision floating-point number.
s_hewitt
+1  A: 

public decimal time;

decimal depending of course on the type you want.

Femaref
+1  A: 

C# has a a DateTime data type, so for dates I would create a variable like this:

public DateTime time;

This lets you do things like subtract dates, and make use of the TimeSpan structure.

RedFilter
+3  A: 

See "Types".

You probably want an int, long, float, double, decimal - or maybe DateTime or TimeSpan.

Eric Mickelsen
+2  A: 

Depending on the type you want:

public double time;

or you could use the DateTime struct provided by .NET

public DateTime time;

or really, you would probably want to create auto-properties for these like this:

public double Time {get;set;}

or

public DateTime Time {get;set;}
Timothy Carter
+3  A: 

AS3 Number is most closely represented by a double in C#

public double time;

Number in AS3

Double in C#

s_hewitt