---
title: "Cobol- Date Function (1 of 2)"
description: "Cobol is simple and powerful language. It is evergreen for 100 yrs now. FUNCTION CURRENT-DATE   ===> will retrieve current date & Time in the below format. Usage: MOVE FUNCTION CURRENT-DATE(1:8)   TO..."
url: https://srinimf.com/2011/12/04/cobol-date-function-1/
date: 2011-12-04
modified: 2026-10-05
author: "Srini"
categories: ["COBOL"]
tags: ["cobol", "Date function", "Time function"]
type: post
lang: en
---

# Cobol- Date Function (1 of 2)

Cobol is simple and powerful language. It is evergreen for 100 yrs now.

[FUNCTION CURRENT-DATE](https://srinimf.com/2015/10/15/limitations-of-cobol-intrinsic-functions/)  ===> will retrieve current date & Time in the below format.

**Usage:** MOVE *FUNCTION CURRENT-DATE(1:8)*  TO WS-CURRENT-DATE

By using MOVE and Reference modification we can retrieve the part of  it as needed.

01  WS-CURRENT-DATE-FIELDS.

             05  WS-CURRENT-DATE.

                 10  WS-CURRENT-YEAR        PIC  9(4).

                 10  WS-CURRENT-MONTH   PIC  9(2).

                 10  WS-CURRENT-DAY        PIC  9(2).

             05  WS-CURRENT-TIME.

                 10  WS-CURRENT-HOUR       PIC  9(2).

                 10  WS-CURRENT-MINUTE  PIC  9(2).

                 10  WS-CURRENT-SECOND  PIC  9(2).

                 10  WS-CURRENT-MS           PIC  9(2).

             05  WS-DIFF-FROM-GMT       [PIC S9](https://srinimf.com/2015/12/26/3-ingenious-cobol-occurs-examples-that-you-never-miss/)(4).

I wiil add some more in part-2.

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2011%2F12%2F04%2Fcobol-date-function-1%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2026%2F02%2Fcropped-logo.png%3Ffit%3D96%252C96%26ssl%3D1&description=Cobol-%20Date%20Function%20%281%20of%202%29)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2011/12/04/cobol-date-function-1/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2011/12/04/cobol-date-function-1/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2011/12/04/cobol-date-function-1/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2011/12/04/cobol-date-function-1/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Cobol-%20Date%20Function%20%281%20of%202%29&body=https%3A%2F%2Fsrinimf.com%2F2011%2F12%2F04%2Fcobol-date-function-1%2F&share=email)
-

### Like this:

Like Loading…
