Skip to content

Instantly share code, notes, and snippets.

@imcsk8
Created September 13, 2018 22:41
Show Gist options
  • Save imcsk8/2662d710902cf0cad5f062eb9c9a74e6 to your computer and use it in GitHub Desktop.
Save imcsk8/2662d710902cf0cad5f062eb9c9a74e6 to your computer and use it in GitHub Desktop.
Programmers day code
/**
*
* Fun code for programmers day
* Programmers day is the 256th day of the year
* https://en.wikipedia.org/wiki/Day_of_the_Programmer
* Iván Chavero <[email protected]>
*
**/
#include <stdio.h>
#include <time.h>
void main(void) {
time_t t = time(NULL);
struct tm *today = localtime(&t);
if(today->tm_yday == 255) {
printf("Happy Programmers day!!\n");
}
else {
printf("Happy shitty normal day!!\n");
}
}
/**
*
* Fun code for programmers day
* Programmers day is the 256th day of the year
* https://en.wikipedia.org/wiki/Day_of_the_Programmer
* Iván Chavero <[email protected]>
*
**/
package main
import (
"fmt"
"time"
)
func main() {
daynum := time.Now().YearDay()
if daynum == 256 {
fmt.Printf("Happy programmer's day!!\n")
} else {
fmt.Printf("Happy shitty normal day!!\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment