Skip to content

Commit

Permalink
Refactor date module
Browse files Browse the repository at this point in the history
  • Loading branch information
ikhsan3adi committed Dec 25, 2024
1 parent d0ab0bb commit f499193
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
8 changes: 3 additions & 5 deletions date.c
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@
#include <time.h>
#include <stdio.h>

// Variabel/konstanta global
// Array untuk menyimpan nama bulan singkat
static char *month_names[12] = {"Jan", "Feb", "Mar", "Apr",
"Mei", "Jun", "Jul", "Aug",
"Sep", "Okt", "Nov", "Des"};
char *month_names[12] = {"Jan", "Feb", "Mar", "Apr",
"Mei", "Jun", "Jul", "Aug",
"Sep", "Okt", "Nov", "Des"};

DateTime create_date(int year, int month, int day, int hour, int minute, int second)
{
Expand Down
3 changes: 3 additions & 0 deletions date.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ typedef struct
int second;
} DateTime;

/// Array string untuk menyimpan nama bulan singkat
extern char *month_names[12];

/**
* Fungsi untuk membuat tanggal dan waktu
* @param year tahun
Expand Down

0 comments on commit f499193

Please sign in to comment.