-
Notifications
You must be signed in to change notification settings - Fork 896
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #98 from BilgisayarKavramlari/3.1.-Ekrana-Tarihi-B…
…asan-Kod Ekrana tarihi basan kod Javascript
- Loading branch information
Showing
11 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#include <iostream> | ||
using namespace std; | ||
#include <ctime> | ||
|
||
int main () { | ||
|
||
time_t now = time(0); | ||
char* dt = ctime(&now); | ||
cout << "Bugunun Tarihi: " << dt; | ||
return 0; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
class Program | ||
{ | ||
/// <summary> | ||
/// Konsola Tarih Bilgisini Basan C# Kod Örneği | ||
/// </summary> | ||
|
||
static void Main(string[] args) | ||
{ | ||
//Tarih bilgisini tutması için DateTime adında bir değişken oluşturuyoruz. | ||
DateTime simdi; | ||
|
||
//Şu anki zaman bilgisini simdi adlı değişkene atıyoruz. | ||
simdi = DateTime.Now; | ||
|
||
// Tarihi konsola yazdırıyoruz. | ||
Console.WriteLine("Sayi : {0}", simdi); | ||
|
||
//Konsolun hemen kapanmasını engellemek için kullanıcıdan bir tuşa basmasını istiyoruz. | ||
Console.WriteLine("Çıkış Yapmak İçin Bir Tuşa Basınız"); | ||
Console.ReadKey(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<!-- HTML + JavaScript kullanılmıştır --> | ||
|
||
<html> | ||
|
||
<p>Lütfen günü giriniz:</p> | ||
<input id="gün" type="number"> | ||
|
||
<p>Lütfen ayı giriniz:</p> | ||
<input id="ay" type="number"> | ||
|
||
<p>Lütfen yılı giriniz:</p> | ||
<input id="yıl" type="number"> | ||
<br><br> | ||
<button onclick="TarihiYaz()">Tarihi ver!</button> | ||
<script src="tarihokuryazar.js"></script> | ||
|
||
</html> | ||
|
||
//tarihokuryazar.js dosyası: | ||
|
||
function TarihiYaz() { | ||
var gün, ay, yıl; | ||
gün = document.getElementById('gün').value | ||
ay = document.getElementById('ay').value | ||
yıl = document.getElementById('yıl').value | ||
document.write("Gün, ay, yıl: " + gün + "." + ay + "." + yıl + "<br>"); | ||
document.write("Ay, gün, yıl: " + ay + "." + gün + "." + yıl + "<br>"); | ||
document.write("Yıl, ay, gün: " + yıl + "." + ay + "." + gün + "<br>"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?php | ||
|
||
echo date('d.m.Y H:i:s'); //Çıktı: 15.01.2017 14:55:00 | ||
echo date('H:i'); // Çıktı: 14:55 | ||
|
||
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
import datetime | ||
# datetime Kütüphanesi import edilir | ||
|
||
a = datetime.datetime.now() | ||
# library.module.func() | ||
|
||
print(a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/bash | ||
|
||
dt=$(date '+%d/%m/%Y %H:%M:%S'); | ||
echo "$dt" # Çıktı: 12/02/2017 19:09:08 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Created by Kağan on 15.01.2017. | ||
// Copyright © 2017 Kağan Utku Kılıçlı. All rights reserved. | ||
|
||
import Foundation | ||
|
||
let tarih = Date() | ||
let birimler: Set<Calendar.Component> = [.hour, .minute, .day, .month, .year] | ||
let sonuc = Calendar.current.dateComponents(birimler, from: tarih) | ||
|
||
print("\(sonuc.day!).\(sonuc.month!).\(sonuc.year!) \(sonuc.hour!):\(sonuc.minute!)") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import java.util.Scanner; | ||
|
||
public class TarihOkurYazar { | ||
|
||
public static void main(String[] args) { | ||
Scanner key = new Scanner(System.in); | ||
System.out.println("sayi olarak bir gün giriniz"); | ||
int gün = key.nextInt(); | ||
System.out.println("sayi olarak bir ay giriniz"); | ||
int ay = key.nextInt(); | ||
System.out.println("sayi olarak bir yil giriniz"); | ||
int yil = key.nextInt(); | ||
|
||
System.out.println(gün + "." + ay + "." + yil); | ||
System.out.println(ay + "." + gün + "." + yil); | ||
System.out.println(yil + "." + ay + "." + gün); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import java.util.Scanner; | ||
|
||
/** | ||
* Created by ahmetturkmen on 1/15/17. | ||
*/ | ||
public class TarihOkurYazar { | ||
public static void main(String[] args) { | ||
|
||
Scanner read = new Scanner(System.in); | ||
System.out.printf("Lütfen günü giriniz: "); | ||
int gun = read.nextInt(); | ||
System.out.printf("Lütfen ayı giriniz: "); | ||
int ay = read.nextInt(); | ||
System.out.printf("Lütfen yılı giriniz: "); | ||
int yil = read.nextInt(); | ||
|
||
if (ay < 10 && ay > 0 && gun >= 10) { | ||
System.out.println("Gün ay yıl: " + gun + "." + "0" + ay + "." + yil); | ||
System.out.println("Ay gün yıl: " + "0" + ay + "." + gun + "." + yil); | ||
System.out.println("Yıl ay gün: " + yil + "." + "0" + ay + "." + gun); | ||
} else if (gun < 10 && gun > 0 && ay >= 10) { | ||
System.out.println("Gün ay yıl: " + "0" + gun + "." + ay + "." + yil); | ||
System.out.println("Ay gün yıl: " + ay + "." + "0" + gun + "." + yil); | ||
System.out.println("Yıl ay gün: " + yil + "." + "0" + ay + "." + "0" + gun); | ||
}else if (gun < 10 && gun > 0 && ay < 10 && ay > 0){ | ||
System.out.println("Gün ay yıl: " + "0" + gun + "." +"0"+ ay + "." + yil); | ||
System.out.println("Ay gün yıl: " + "0"+ ay + "." + "0" + gun + "." + yil); | ||
System.out.println("Yıl ay gün: " + yil + "." + "0" + ay + "." + "0" + gun); | ||
|
||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package bilgisayarkavramlari; | ||
import java.util.Scanner; | ||
public class BilgisayarKavramlari { | ||
public static void main(String[] args) { | ||
Scanner tarihGir = new Scanner(System.in); | ||
System.out.print("Lütfen günü giriniz: "); | ||
int gun = tarihGir.nextInt(); | ||
System.out.print("Lütfen ayı giriniz: "); | ||
int ay = tarihGir.nextInt(); | ||
System.out.print("Lütfen yılı giriniz: "); | ||
int yil = tarihGir.nextInt(); | ||
System.out.println("Gün ay yıl :"+gun+"."+ay+"."+yil); | ||
System.out.println("Ay gün yıl :" +ay+"."+gun+"."+yil); | ||
System.out.println("Yıl ay gün :" +yil+"."+gun+"."+ay); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
/Created by Oğuz Kaan BULUT. | ||
//All rights reserved. | ||
|
||
#include <stdio.h> | ||
#include <time.h> | ||
#include <conio.h> | ||
|
||
void main(){ | ||
|
||
time_t t; | ||
|
||
t = time(NULL); | ||
printf("Gunun tarih ve saati: %s",ctime(&t)); | ||
|
||
getch(); | ||
} |