Tips n Tracks

  • Increase font size
  • Default font size
  • Decrease font size
  • default color
  • black color

Reference

Sample image

Microsoft .NET Framework Get Details.

Sample image

Microsoft .NET Framework Get Details.

Reference

Sample image Microsoft .NET Framework Get Details.
Sample image

Microsoft .NET Framework Get Details.


Working with System.DateTime – Date and Time String Formatting with C#


Working with System.DateTime – Date and Time String Formatting with C#

Software Development with C# needs to work with dates and times. To work efficiently with Date and Time .NET has the System.DateTime (DateTime) namespace to help us. You can use DateTime to get DateTime values, generate new DateTime values and format DateTime values (parse strings into DateTime or DateTime in the string format).

Creating New DateTime Objects with C#

The default value of DateTime is Jan 1, 0001 at 12:00 midnight.

DateTime newDate = new DateTime();
Console.WriteLine("date: {0}", newDate); //date: 1/1/0001 12:00:00 AM

Creating New DateTime through the constructor

You can initialize the DateTime through the constructor using several pre-define options.

System.DateTime newDate = new System.DateTime(2010, 9, 5, 21, 35, 15, 777);
Console.WriteLine("date: {0}", newDate);//date: 9/5/2010 9:35:15 PM

If you need the current date and time? DateTime.Now will do it for you.

System.DateTime newDate = System.DateTime.Now;
Console.WriteLine("date: {0}", newDate);// Current Date Time will be display

Date and Time String Formatting with C#

The date and time value can be represented by either a DateTime or a DateTimeOffset value. Date and Time String Formatting fall into two categories:

  • Standard Date and Time String Formatting
  • Custom Date and Time String Formatting


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Expressions and Operators


Learning JavaScript tutorial – JavaScript Expressions and Operators

JavaScript Expressions and Operators are very similar with most popular programming languages like C, C++, or Java. In this chapter we take an overview of the basic building blocks of JavaScript: operators, expressions.

JavaScript Expressions

JavaScript Expression is a combination of values, variables, operators, and functions that are interpreted (evaluated) as per the program logic define(develop) by JavaScript programmer. For example consider mathematical expression: 4+3 is an arithmetic and programming expression which evaluates to 7. The assignment expression x=4+3 also evaluates to 7 and assign that value to variable x. The expression is use to evaluate the the values for pre-define JavaScript program logic.

var intNum;  //Expression to declare a variable
var intNum=10; //Expression to declare a variable with assigned initial value
var x=5, y=4, z=x+y; //Expressions to declared multiple variables

JavaScript Operators

JavaScript supports a variety of operators like arithmetic, logical and comparison etc. An operator is a function which acts on any number of operands (inputs) to produce a pre-define operation.


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Reserved KeyWords


Learning JavaScript tutorial – JavaScript Reserved KeyWords

JavaScript Reserved KeyWords are part of the JavaScript language syntax. JavaScript Reserved KeyWords has special meanings and used to instruct JavaScript interpreter to perform a specific pre define task. JavaScript has some reserved keywords which can not be used as an identifier. Using JavaScript Reserved KeyWords as an identifier for variable names, function names, and loop labels results in error.

Table 1 -JavaScript 1.5 Reserved KeyWords
abstract boolean break byte case
catch char class const delete
debugger default delete do double
else enum export extends false
final finally float for function
goto if implements import in
instanceof int interface long native
new null package private protected
public return short static super
switch synchronized this throw throws
transient true try typeof val
var void volatile while with


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Variables


Learning JavaScript tutorial – JavaScript Variables

JavaScript Variables are the main building blocks of JavaScript Scripting language. JavaScript Variables are used for storing (contains) the data (value) and manipulate that data in your programs.

Every JavaScript variable has a name, called its ‘identifier’ and optional data called ‘Literals’. JavaScript Variables are declared using JavaScript ‘var’ keyword. JavaScript var keyword allocates storage space for variable to store data. Multiple variables can be declared with one JavaScript ‘var’ keyword. The main advantage of JavaScript variable is, it can hold a value of any data type. Using an undeclared variable causes an error. The best practice of defining JavaScript Variables is with assigned initial values.

var intNum;  //variable intNum is declared
var intNum=10; //variable declared with assigned initial values
var x=5, y=4, z=x+y; //multiple variables with one var keyword


Read the rest of this entry »

Learning JavaScript tutorial – JavaScript Literals and Identifiers


Learning JavaScript tutorial – JavaScript Literals and Identifiers

JavaScript Literals

JavaScript Literals are the notation for representing a fixed data value that appears directly in a JavaScript program. JavaScript Literals helps us to assign values (initialize) to various JavaScript Data Types and Variables; such as integers, floating-point numbers, strings, and Booleans; enumerated Data Types and compound values such as arrays, records, and objects.

var intNum = 82    // 82 is a integer literal
var PI = 3.14        // 3.14 is a float literal
var strInfo="This is a string" // this is a string literal
var strGreet=‘Hello!’;   // another string literal
var isMale=true          // A Boolean value literal
var arrAnimal={"cat","dog"}    // array literals


Read the rest of this entry »