Need help for GSM 900 and DS3231 interfacing.

This is a part of my project I have used DS3231 for real time which is correctly displaying time in the lcd module but at same time when I want to send message through gsm module I want that it should display the time in message too for this I need help that how should I would take time from DS3231 and send in message
Please help me
I have attached code
Code is
#include <SoftwareSerial.h>
#include <Wire.h>
#include <ds3231.h>
#include <LiquidCrystal_I2C.h>
#define BUFF_MAX 128

#define I2C_ADDR 0x27

#define Rs_pin 0
#define Rw_pin 1
#define En_pin 2
#define BACKLIGHT_PIN 3
#define D4_pin 4
#define D5_pin 5
#define D6_pin 6
#define D7_pin 7

#define LED_OFF 0
#define LED_ON 1

/-----( Declare objects )-----/
LiquidCrystal_I2C lcd(0x27, 16, 2);

uint8_t time[8];
char recv[BUFF_MAX];
unsigned int recv_size = 0;
unsigned long prev, interval = 1000;
SoftwareSerial mySerial(9, 10);

void setup()
{
mySerial.begin(9600);
Serial.begin(9600);
delay(100);
Wire.begin();
DS3231_init(DS3231_INTCN);
memset(recv, 0, BUFF_MAX);
Serial.println(“GET time”);

lcd.begin (); // initialize the lcd
// Switch on the backlight
//lcd.setBacklightPin(BACKLIGHT_PIN,POSITIVE);
lcd.setBacklight(LED_ON);

Serial.println(“Setting time”);
//setTheTime(“303022724062018”); // ssmmhhWDDMMYYYY set time once in the given format

}

void loop()
{
if (Serial.available()>0)
switch(Serial.read())
{
case ‘s’:
SendMessage();
break;
}
char tempF[6];
float temperature;
char buff[BUFF_MAX];
unsigned long now = millis();
struct ts t;
// show time once in a while
if (now - prev > interval){
DS3231_get(&t); //Get time
temperature = DS3231_get_treg(); //Get temperature
dtostrf(temperature, 5, 1, tempF);

lcd.clear();
lcd.setCursor(0,1);

lcd.print(t.mday);

printMonth(t.mon);

lcd.print(t.year);
delay(2000);
lcd.clear();
lcd.setCursor(0,1);
lcd.print(t.hour);
lcd.print(":");
if(t.min<10)
{
lcd.print(“0”);
}
lcd.print(t.min);
lcd.print(":");
if(t.sec<10)
{
lcd.print(“0”);
}
lcd.print(t.sec);

lcd.print(’ ');
//delay(2000);

lcd.print(tempF);
lcd.print((char)223);
lcd.print("C ");
delay(2000);
prev = now;

}

}

void setTheTime(char *cmd)
{
struct ts t;

// ssmmhhWDDMMYYYY set time

t.sec = inp2toi(cmd, 0);
t.min = inp2toi(cmd, 2);
t.hour = inp2toi(cmd, 4);
t.wday = inp2toi(cmd, 6);
t.mday = inp2toi(cmd, 7);
t.mon = inp2toi(cmd, 9);
t.year = inp2toi(cmd, 11) * 100 + inp2toi(cmd, 13);
DS3231_set(t);
Serial.println(“OK”);
}

void printMonth(int month)
{
switch(month)
{
case 1: lcd.print(" January “);break;
case 2: lcd.print(” February “);break;
case 3: lcd.print(” March “);break;
case 4: lcd.print(” April “);break;
case 5: lcd.print(” May “);break;
case 6: lcd.print(” June “);break;
case 7: lcd.print(” July “);break;
case 8: lcd.print(” August “);break;
case 9: lcd.print(” September “);break;
case 10: lcd.print(” October “);break;
case 11: lcd.print(” November “);break;
case 12: lcd.print(” December “);break;
default: lcd.print(” Error ");break;
}
}
void SendMessage()
{
mySerial.println(“AT+CMGF=1”);
delay(1000);
mySerial.println(“AT+CMGS=“x”\r”); // Replace x with mobile number
delay(1000);
mySerial.println(“YOUR WARD IS NOW ON TIME @”);// WHERE I WANT TO SEND MESSAGE WITH TIME
delay(100);
mySerial.println((char)26);
delay(1000);
}

You seem to be printing the time onto the LCD OK so why can't you "print" it to the GSM ?

I know that that's why I am asking for your suggestion that where I am going wrong. Or what should I do next to print time in gsm

 mySerial.println("YOUR WARD IS NOW ON TIME @");// WHERE I WANT TO SEND MESSAGE WITH TIME

Do NOT put comments like that at the end of the line. That is NOT where you would put the code.

As was already pointed out, you CLEARLY know how to print() the time using the lcd instance. The process to print() the time using the (stupidly named) mySerial instance is EXACTLY the same.

You don't really have a mySerial connected to the Arduino, do you? The name of the instance of the SoftwareSerial class should reflect what is attached.

You wouldn't get an instance of the Dog class and call it myDog, would you?