Size (bytes) | Visual Basic.net | C#.net | Common Runtime Language | Value Range |
01 | Byte | byte | System.Byte | 0 to 255 |
01 | (Not Implemented) | sbyte | System.Sbyte | -128 to 127 |
02 | Boolean | bool | System.Boolean | True or False only |
02 | Char | char | System.Char | 0 to 65535 |
02 | Short | short | System.Int16 | -32,768 to 32,767. |
02 | (Not Implemented) | ushort | System.UInt16 | 0 to 65535 |
04 | Integer | int | System.Int32 | -2,147,483,648 to 2,147,483,647 |
04 | (Not Implemented) | uint | System.Uint32 | 0 to 4294967295 |
04 | Single | float | System.Single | -3.4028235E+38 to -1.401298E-45 for negative values; 1.401298E-45 to 3.4028235E+38 for positive values. |
04 | Object | object | System.Object | Any type can be stored in a variable of type Object. |
08 | Date | DateTime | System.DateTime | 0:00:00 on January 1, 0001 through 11:59:59 PM on December 31, 9999. |
08 | Long | long | System.Int64 | -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. |
08 | (Not Implemented) | ulong | System.UInt64 | 0 to 18446744073709551615 |
08 | Double | double | System.Double | -1.79769313486231570E+308 to -4.94065645841246544E-324 for negative values; 4.94065645841246544E-324 through 1.79769313486231570E+308 for positive values. |
16 | Decimal | decimal | System.Decimal | 0 to +/-79,228,162,514,264,337,593,543,950,335 with no decimal point;0 through +/-7.9228162514264337593543950335 with 28 places to the right of the decimal; smallest nonzero number is +/-0.0000000000000000000000000001 (+/-1E-28). |
Varies | structure | struct | System.ValueType | Each member of the structure has a range determined by its data type and independent of the ranges of the other members. |
Varies | String | string | System.String | 0 to approximately 2 billion Unicode characters |
Format Pattern | Description |
d | The day of the month. Single-digit days will not have a leading zero. |
dd | The day of the month. Single-digit days will have a leading zero. |
ddd | The abbreviated name of the day of the week |
dddd | The full name of the day of the week |
M | The numeric month. Single-digit months will not have a leading zero. |
MM | The numeric month. Single-digit months will have a leading zero. |
MMM | The abbreviated name of the month |
MMMM | The full name of the month |
y | The year without the century. If the year without the century is less than 10, the year is displayed with no leading zero. |
yy | The year without the century. If the year without the century is less than 10, the year is displayed with a leading zero. |
yyyy | The year including the century in four digits. |
gg | The period or era. This pattern is ignored if the date to be formatted does not have an associated period or era string. |
h | The hour in a 12-hour clock. Single-digit hours will not have a leading zero. |
hh, hh* | The hour in a 12-hour clock. Single-digit hours will have a leading zero. |
H | The hour in a 24-hour clock. Single-digit hours will not have a leading zero. |
HH, HH* | The hour in a 24-hour clock. Single-digit hours will have a leading zero.a |
m | The minute. Single-digit minutes will not have a leading zero. |
mm, mm* | The minute. Single-digit minutes will have a leading zero. |
s | The second. Single-digit seconds will not have a leading zero. |
ss, ss* | The second. Single-digit seconds will have a leading zero. |
t | The first character in the AM/PM designator |
tt, tt* | The AM/PM designator |
z | The timezone offset (hour only). Single-digit hours will not have a leading zero. |
zz | The timezone offset (hour only). Single-digit hours will have a leading zero. |
zzz, zzz* | The full timezone offset (hour and minutes). Single-digit hours and minutes will have leading zeros. |
: | The default time separator |
/ | The default date separator |
% c | Where c is a standard format character. Displays the standard format pattern associated with the format character. |
\ c | Where c is any character. Displays the character literally. |