You are on page 1of 3

using System;

using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace cas4
{
class Program
{
static void Main(string[] args)
{
//var now = DateTime.Now;
//Console.WriteLine(now.ToShortDateString());
//Console.WriteLine(now.ToLongTimeString());
//Console.WriteLine(now.ToShortTimeString());
//var today = DateTime.Today;
//Console.WriteLine(today);

//var independenceDayMk = new DateTime(1991, 9, 8); //godina, mesec,


den
//Console.WriteLine(independenceDayMk.ToString("yyyy-MM-dd
HH:mm:ss.fff"));
//independenceDayMk.Date;
// independenceDayMk.Day;
//new Date (1991, 9, 8)

//Console.WriteLine(DateTime.Today.AddDays(3));
//Console.WriteLine(DateTime.Today.AddMonths(1));
//Console.WriteLine(DateTime.Today.AddMonths(1).AddDays(3));
//Console.WriteLine(DateTime.Today.AddYears(1).AddMonths(2));
//Console.WriteLine(DateTime.Today.ToString("MMMM"));
//Console.WriteLine(DateTime.Today.ToString("dd"));
//Console.WriteLine(DateTime.Now.Year);

Console.WriteLine("Enter your birthdate (in format yyyy-mm-dd)");


int birthdate = int.Parse(Console.ReadLine());

var today = DateTime.Today;

var a = (today.Year * 100 + today.Month) * 100 + today.Day;

var b = ((birthdate.Year * 100 + birthdate.Month) * 100 +


birthdate.Day);

return (a - b) / 10000;
//Substrings(5);
//working with methods, dates and strings
//sekogash funkcijata pripagja na nekoj objekt i ja vikame metoda
//ako ne staime return vo js funkcijata kje vrati undefined
//mora da se int Add(int x, int y){
// return x+y;
//}
//string builder za generiranje na stringovi

//ova se vika akcija a ne funkcija....vo ne void metodite mora da se


vrati nesto a vo void metodi ne smee da se vrati nesto!
//void Print (int x){
// Console.WriteLine($" The value is {x}");
// }

//Print(Add(3, 4));
//while (true) {
// Console.Clear();
// Console.WriteLine("please enter an operator (you could enter + or
-) ");

// string Operator = Console.ReadLine();


// Console.WriteLine("please enter the first number?");
// int numberOne = int.Parse(Console.ReadLine());
// Console.WriteLine("please enter the second number?");
// int numberTwo = int.Parse(Console.ReadLine());

// if (Operator == "+")
// {
// Console.WriteLine(Add(numberOne, numberTwo));
// Console.ReadLine();
// }
// else if (Operator == "-")
// {
// Console.WriteLine(Subst(numberOne, numberTwo));
// Console.ReadLine();
// }
// else
// {
// Console.WriteLine("not a valid");
// }

//}
//custom and standard numeric format strings

//Console.WriteLine("please enter a number?");


//int InputSub = int.Parse(Console.ReadLine());
//-----------------------------------------------------------
//Working with Dates C#

//date time, utc - nezavisen od vremenski zoni


//opredelena specificna tocka na vremenska oska
//time span??
// 2019-03-04 20:45:32.123
//-----------------------------------------------------------

}
//---------------------------------------//

//static void Substrings(int x)


//{
// string name = "Hello from Sedc CodeAcademy v7.0";
// Console.WriteLine(name.Substring(0, 5));

//}

//za doma nie da kazeme koj string i kade da presece i pc to da napravi dva
stringa od toa edno
//static int Add(int first, int second)
//{
// return first + second;
//}

//static int Subst(int noOne, int noTwo)


//{
// return noOne - noTwo;
//}

//static void Print(int x)


//{
// Console.WriteLine($"The value is {x}");
//}

//static void Print1(int y)


//{
// Console.WriteLine($"The value is {y}");
//}

//static void Main(int x)


//{

//}
}
}

You might also like